<template>
	<view class="container" :style="{background:jumpType&&jumpType=='mailun'?'#FFE7FF':'#ffffff'}" v-if="!isPageLoad">
		<template v-if="showFullPageAlert">
			<sclNoticeIqPage v-if="noticePage == 'iq'" @ok="confirmFullTip" :referenceList="referenceList" />
			<sclNoticePageAboutEqTMMS v-else-if="noticePage == 'eq'" @ok="confirmFullTip"
				:referenceList="referenceList" />
			<sclNoticePageAboutJobMBTI v-else-if="noticePage == 'job-mbti'" @ok="confirmFullTip"
				:referenceList="referenceList" />
			<sclNoticePageAboutLoveMBTI v-else-if="noticePage == 'love-mbti'" @ok="confirmFullTip"
				:referenceList="referenceList" />
			<sclNoticePageAboutXgMBTI v-else-if="noticePage == 'xg-mbti'" @ok="confirmFullTip"
				:referenceList="referenceList" />
			<sclNoticePageAboutCRYL v-else-if="noticePage == 'love-cryl'" @ok="confirmFullTip"
				:referenceList="referenceList" />
			<sclNoticePageAboutAnimalForest v-else-if="noticePage == 'animalforest'" @ok="confirmFullTip"
				:referenceList="referenceList" />
			<sclNoticePageAboutBestxg v-else-if="noticePage == 'bestxg'" @ok="confirmFullTip"
				:referenceList="referenceList" />
			<sclNoticePageAboutGoddess v-else-if="noticePage == 'goddess'" @ok="confirmFullTip"
				:referenceList="referenceList" />
			<sclNoticePage v-else @ok="confirmFullTip" :referenceList="referenceList" />
		</template>

		<template v-else-if="isShowQuestionPage">
			<scl-do-quesiton-about-mbti :animationFlag="animationFlag"
				v-if="questionPageType == 'job-mbti' ||questionPageType == 'love-mbti' ||questionPageType == 'xg-mbti'"
				@backHandle="backHandle" :mbtiType="questionPageType" :max="questionList.length"
				:current="currentIndex + 1" :countTime="countTime" :percent="percent"
				:questionType="questionList[currentIndex].optHasImg" :optnList="questionList[currentIndex].optnList"
				:question="questionList[currentIndex].qstnContent" :showGift="isShowGiftAbs"
				@updateSelectSclQuestion="updateSelectSclQuestion" @next="nextQuestion" @prev="preQeustion"
				@go="goDirectory" />
			<sclDoQuesitonAboutIq v-else-if="questionPageType == 'iq-spm'" @backHandle="backHandle"
				:mbtiType="questionPageType" :max="questionList.length" :current="currentIndex + 1"
				:countTime="countTime" :percent="percent" :questionType="questionList[currentIndex].optHasImg"
				:optnList="questionList[currentIndex].optnList" :questionObj="questionList[currentIndex]"
				:showGift="isShowGiftAbs" @changeCurrentInput="changeCurrentInput"
				@updateSelectSclQuestion="updateSelectSclQuestion" @next="nextQuestion" @prev="preQeustion"
				@go="goDirectory" ref="sclDoQuesitonAboutIq" />
			<sclDoQuesitonAboutEq v-else-if="questionPageType == 'eq-tmms'" @backHandle="backHandle"
				:mbtiType="questionPageType" :max="questionList.length" :current="currentIndex + 1"
				:countTime="countTime" :percent="percent" :questionType="questionList[currentIndex].optHasImg"
				:optnList="questionList[currentIndex].optnList" :questionObj="questionList[currentIndex]"
				:showGift="isShowGiftAbs" @changeCurrentInput="changeCurrentInput"
				@updateSelectSclQuestion="updateSelectSclQuestion" @next="nextQuestion" @prev="preQeustion"
				@go="goDirectory" />
			<sclDoQuesitonAboutCRYL
				v-else-if="questionPageType == 'love-cryl' ||questionPageType == 'love-mbti' ||questionPageType == 'xg-mbti'"
				@backHandle="backHandle" :mbtiType="questionPageType" :max="questionList.length"
				:current="currentIndex + 1" :countTime="countTime" :percent="percent"
				:questionType="questionList[currentIndex].optHasImg" :optnList="questionList[currentIndex].optnList"
				:question="questionList[currentIndex].qstnContent" :showGift="isShowGiftAbs"
				@updateSelectSclQuestion="updateSelectSclQuestion" @next="nextQuestion" @prev="preQeustion"
				@go="goDirectory" />

			<sclDoQuesitonAboutMaiLun v-else-if="questionPageType == 'mailun'" @backHandle="backHandle"
				:mbtiType="questionPageType" :max="questionList.length" :current="currentIndex + 1"
				:countTime="countTime" :percent="percent" :questionType="questionList[currentIndex].optHasImg"
				:optnList="questionList[currentIndex].optnList" :question="questionList[currentIndex].qstnContent"
				:showGift="isShowGiftAbs" @updateSelectSclQuestion="updateSelectSclQuestion" @next="nextQuestion"
				@prev="preQeustion" @go="goDirectory" />
			<sclDoQuesitonAboutQX v-else-if="questionPageType == 'qx'" @backHandle="backHandle"
				:mbtiType="questionPageType" :max="questionList.length" :current="currentIndex + 1"
				:countTime="countTime" :percent="percent" :questionType="questionList[currentIndex].optHasImg"
				:optnList="questionList[currentIndex].optnList" :question="questionList[currentIndex].qstnContent"
				:showGift="isShowGiftAbs" @updateSelectSclQuestion="updateSelectSclQuestion" @next="sclQxNextQuestion"
				@prev="preQeustion" @go="goDirectory" />
			<!--动物森林-->
			<sclDoQuestionAboutAnimalForest v-else-if="questionPageType == 'animalforest'" @backHandle="backHandle"
				:max="questionList.length" :current="currentIndex + 1" :countTime="countTime"
				:optnList="questionList[currentIndex].optnList" :question="questionList[currentIndex].qstnContent"
				@updateSelectSclQuestion="updateSelectSclQuestion" @next="nextQuestion" @prev="preQeustion"
				@go="goDirectory" />
			<sclDoQuesitonAboutDongWuLianAi v-else-if="questionPageType == 'dongwulianai'" @backHandle="backHandle"
				:questionList="questionList" :showGift="isShowGiftAbs" :paramObj="paramObj" />
			<!--颜色性格-->
			<sclDoQuesitonAboutFpacpt v-else-if="questionPageType == 'fpacpt'" @backHandle="backHandle"
				:max="questionList.length" :current="currentIndex + 1" :countTime="countTime"
				:optnList="questionList[currentIndex].optnList" :question="questionList[currentIndex].qstnContent"
				@updateSelectSclQuestion="updateSelectSclQuestion" @next="nextQuestion" @prev="preQeustion" />
			<!--BEST性格-->
			<sclDoQuestionAboutBestxg v-else-if="questionPageType == 'bestxg'" @backHandle="backHandle"
				:max="questionList.length" :current="currentIndex + 1" :countTime="countTime"
				:optnList="questionList[currentIndex].optnList" @updateSelectSclQuestion="updateSelectSclQuestion"
				@next="nextQuestion" @prev="preQeustion" @go="goDirectory" :dialogText="dialogText"
				:reloadHistoryVisible="reloadHistoryVisible" />
			<!--女王测评-->
			<sclDoQuestionAboutQueen v-else-if="questionPageType == 'queen'" @backHandle="backHandle"
				:max="questionList.length" :current="currentIndex + 1" :countTime="countTime"
				:optnList="questionList[currentIndex].optnList" :question="questionList[currentIndex].qstnContent"
				@updateSelectSclQuestion="updateSelectSclQuestion" @next="nextQuestion" @prev="preQeustion"
				@go="goDirectory" />
			<view v-else-if="'mentalHealth' !== containerClassName || questionListShow"
				:class="['container', 'do-page-container', containerClassName]"
				:style="[{background: computedBgStyle,backgroundSize: 'cover'}]">
				<navigationBar :emitBackEvent="true" @backEvent="backHandle" :my-property="navigationBarDataInfo" />
				<view class="center-box">
					<view class="question-content-box">
						<view class="question-info-wrapper">
							<view class="qcb-num" v-if="doQuestionType != 'jump'">
								问题 {{ currentIndex + 1 }}<text
									class="max-question-length">/{{questionList.length}}</text>
							</view>

							<view class="clock-wrapper" v-if="countTime!='00:00'">
								<image class="clock-icon" :src="staticImgs.clockImg" mode="widthFix"></image>
								<view class="clock-text">
									{{ countTime }}
								</view>
							</view>
						</view>
						<view class="scroll-wrap-qst">
							<scroll-view class="scroll-y-view" enhanced :show-scrollbar="true" scroll-y="true"
								style="height: 100%">
								<view class="qcb-title">{{questionList[currentIndex].qstnContent || ""}}</view>
							</scroll-view>
						</view>
						<view style="display: flex;justify-content: center;margin-bottom: 24rpx;">
							<!-- <image @click="previewImg(questionList[currentIndex].qstnImg)" style="width: 300rpx;background-color: rgba(100,100,100, .1);" v-if="questionList[currentIndex].qstnImg" :src="questionList[currentIndex].qstnImg" mode="widthFix"></image> -->
							<image @click="previewImg(questionList[currentIndex].qstnImg)"
								style="width: 300rpx; background-color: #fbfbfb"
								v-if="questionList[currentIndex].qstnImg" :src="questionList[currentIndex].qstnImg"
								mode="widthFix"></image>
						</view>
						<view class="scroll-wrap">
							<scroll-view class="scroll-y-view" enhanced :show-scrollbar="true" scroll-y="true"
								style="height: 100%">
								<template v-if="questionList[currentIndex].subjectivity">
									<view class="input-wrapper"
										v-if="skipValidationFieldId == questionList[currentIndex].id">
										<u--input v-if="!reloadInputBox"
											:placeholder="questionList[currentIndex].qstnContent" clearable
											@input="inputEventHandle_1" :value="currentInputCon">
										</u--input>
									</view>
									<view class="input-wrapper" v-else>
										<u--input v-if="!reloadInputBox"
											:placeholder="questionList[currentIndex].qstnContent" clearable
											@input="inputEventHandle" :value="currentInputCon">
										</u--input>
									</view>
								</template>
								<template v-if="renderOpts">
									<do-scl-question :questionType="questionList[currentIndex].optHasImg"
										:optnList="questionList[currentIndex].optnList"
										@updateSelectSclQuestion="updateSelectSclQuestion"
										:containerClassName="containerClassName"></do-scl-question>
								</template>
							</scroll-view>
						</view>
					</view>
					<template>
						<view class="progress-box" v-if="doQuestionType != 'jump'">
							<view class="progress-flash">
								<image class="img" :src="progressBgFlashImg.img" mode=""></image>
							</view>
							<view class="pb-text" v-if="containerClassName">
								<view class="pb-jd-title">完成进度</view>
								<view class="pb-jd-percent">{{ percent }}%</view>
							</view>
							<view class="pb-text" v-else>
								<view class="pb-jd-percent">{{ percent }}%</view>
								<view class="pb-jd-title">完成进度</view>
							</view>

							<l-circularProgress v-if="!showFullPageAlert"
								:progressColor="progressBgFlashImg.progressColor" :lineWidth="6"
								:gradualColor="progressBgFlashImg.gradualColor" :percent="percent" :boxWidth="100"
								:boxHeight="100">
							</l-circularProgress>

							<template v-if="isShowGiftAbs && !showFullPageAlert">
								<view class="gift-img-abs">
									<view style="position: relative">
										<cover-image class="gift-img" :class="[{ 'animation-open': animationFlag }]"
											:src="staticImgs.giftImg" mode="widthFix"></cover-image>
									</view>
								</view>
								<view class="chat-img-abs"
									:style="{ 'background-image': `url(${staticImgs.chatImg})` }">
									<view>完成测评得</view>
									<view>尊享好礼</view>
								</view>
							</template>

							<template v-if="isShowYiyuanAbs && !showFullPageAlert">
								<view class="gift-img-abs yiyuan-img-bas">
									<view style="position: relative">
										<cover-image class="gift-img" :class="[{ 'animation-open': animationFlag }]"
											:src="staticImgs.yiyuanImg" mode="widthFix"></cover-image>
									</view>
								</view>
								<view class="chat-img-abs yiyuan-chat-img-abs"
									:style="{'background-image': `url(${staticImgs.yiyuanChatImg})`}">
								</view>
							</template>
						</view>
					</template>
				</view>
				<view class="bottom-btn flex-vc">
					<view v-if="showPreBtn" class="bb-pre-next flex-cc" @click="preQeustion">
						<image class="img" v-if="containerClassName === 'sexuality'"
							:src="staticImgs.sexualityPrevImg" />
						<view v-else>上一题</view>
					</view>
					<view v-if="doQuestionType != 'jump'" class="bb-ml flex-cc"
						:style="[{background: 'linear-gradient(180deg, #58B938 0%, #82E3BE 100%)'},{backgroundSize: 'cover'}]"
						@click="goDirectory">
						<image class="img" v-if="containerClassName === 'sexuality'"
							:src="staticImgs.sexualityDirectoryImg" />
						<view class="menu-btn" v-else>
							<text>目录</text>
						</view>
					</view>
					<view v-if="doQuestionType != 'jump'" class="bb-pre-next flex-cc" @click="nextQuestion">
						<image class="img" v-if="containerClassName === 'sexuality'"
							:src="currentIndex == questionList.length - 1 ? staticImgs.sexualitySubmitImg : staticImgs.sexualityNextImg" />
						<view v-else>{{currentIndex == questionList.length - 1 ? "提交" : "下一题"}}</view>
						<view v-if="currentIndex == questionList.length - 1">
							<image :src="test_zhi_yin_shou_zhi" class="back-to-btn-shou-zhi"></image>
						</view>
					</view>
				</view>
			</view>
		</template>

		<view v-else-if="isShowSclBeforeResultLoadPage">
			<SclBeforeResultLoadPageMaiLun v-if="endPageType=='mailun'" @loadOk="loadOkHandle" />
			<SclBeforeResultLoadPage :isMBTI="endPageType == 'A0'" :tit="loadPageTit" @loadOk="loadOkHandle" v-else />
		</view>
		<view v-else-if="isShowSclBeforeResultPageCheckup">
			<SclBeforeResultPageTypeCheckup :sclName="loadPageTit" :referenceList="referenceList"
				:couponInfo="couponInfo" :sclInfo="detail" :sclPayBack="isSclPayBack" @payOk="toResultPageHandle"
				:scrollTopNum="scrollTopNum" :sclId="sclId" :isFromCheckup="isFromCheckup" :isScl90="isScl90"
				:checkupTip="checkupTip" :showCheckupPrice="showCheckupPrice" />
		</view>
		<view v-else-if="isShowSclBeforeResultPageJobMbtiNormal">
			<SclBeforeResultPageTypeNormalJobMBTI :referenceList="referenceList" :couponInfo="couponInfo"
				:sclInfo="detail" :sclPayBack="isSclPayBack" @payOk="toResultPageHandle(true)"
				:scrollTopNum="scrollTopNum" :sclId="sclId" />
		</view>
		<view v-else-if="isShowSclBeforeResultPageJobMbtiCommon">
			<SclBeforeResultPageTypeCommonJobMBTI :referenceList="referenceList" :sclIntro="sclIntro"
				:homeModalType="homeModalType" :goodsGroup="goodsGroupArr" :couponInfo="couponInfo" :sclInfo="detail"
				:sclPayBack="isSclPayBack" @payOk="toResultPageHandle(true)" :scrollTopNum="scrollTopNum"
				:sclId="sclId" />
		</view>
		<view v-else-if="isShowSclBeforeResultPageLoveMbtiNormal">
			<SclBeforeResultPageTypeNormalLoveMBTI :referenceList="referenceList" :couponInfo="couponInfo"
				:sclInfo="detail" :sclPayBack="isSclPayBack" @payOk="toResultPageHandle(true)"
				:scrollTopNum="scrollTopNum" :sclId="sclId" />
		</view>
		<view v-else-if="isShowSclBeforeResultPageLoveMbtiCommon">
			<SclBeforeResultPageTypeCommonLoveMBTI :referenceList="referenceList" :sclIntro="sclIntro"
				:homeModalType="homeModalType" :goodsGroup="goodsGroupArr" :couponInfo="couponInfo" :sclInfo="detail"
				:sclPayBack="isSclPayBack" @payOk="toResultPageHandle(true)" :scrollTopNum="scrollTopNum"
				:sclId="sclId" />
		</view>
		<view v-else-if="isShowSclBeforeResultPageXgMbtiCommon">
			<SclBeforeResultPageTypeCommonXgMBTI :referenceList="referenceList" :sclIntro="sclIntro"
				:homeModalType="homeModalType" :goodsGroup="goodsGroupArr" :qstnNum="compQstnNum" :sclInfo="detail"
				:sclPayBack="isSclPayBack" @payOk="payMultiXgOk" :scrollTopNum="scrollTopNum" :sclId="sclId" />
		</view>
		<view v-else-if="isShowSclBeforeResultPageCrylCommon">
			<SclBeforeResultPageTypeCommonCRYL :goodsGroup="goodsGroupArr" :sclInfo="detail" :sclPayBack="isSclPayBack"
				@payOk="toResultPageHandle(true)" :scrollTopNum="scrollTopNum" :sclId="sclId" />
		</view>
		<view v-else-if="isShowSclBeforeResultPageIqSpmCommon">
			<SclBeforeResultPageTypeCommonIqSPM :sclName="loadPageTit" :referenceList="referenceList"
				:sclIntro="sclIntro" :homeModalType="homeModalType" :goodsGroup="goodsGroupArr" :couponInfo="couponInfo"
				:sclInfo="detail" :sclPayBack="isSclPayBack" @payOk="toResultPageHandle(true)"
				:scrollTopNum="scrollTopNum" :sclId="sclId" />
		</view>
		<view v-else-if="isShowSclBeforeResultPageIqSpmNormal">
			<SclBeforeResultPageTypeNormalIqSPM :sclName="loadPageTit" :referenceList="referenceList"
				:couponInfo="couponInfo" :sclInfo="detail" :sclPayBack="isSclPayBack" @payOk="toResultPageHandle(true)"
				:scrollTopNum="scrollTopNum" :sclId="sclId" />
		</view>
		<view v-else-if="isShowSclBeforeResultPageEqTmmsCommon">
			<SclBeforeResultPageTypeCommonEqTMMS :sclName="loadPageTit" :referenceList="referenceList"
				:sclIntro="sclIntro" :homeModalType="homeModalType" :goodsGroup="goodsGroupArr" :couponInfo="couponInfo"
				:sclInfo="detail" :sclPayBack="isSclPayBack" @payOk="toResultPageHandle(true)"
				:scrollTopNum="scrollTopNum" :sclId="sclId" />
		</view>
		<view v-else-if="isShowSclBeforeResultPageEqTmmsmNormal">
			<SclBeforeResultPageTypeNormalEqTMMS :sclName="loadPageTit" :referenceList="referenceList"
				:couponInfo="couponInfo" :sclInfo="detail" :sclPayBack="isSclPayBack" @payOk="toResultPageHandle(true)"
				:scrollTopNum="scrollTopNum" :sclId="sclId" />
		</view>
		<view v-else-if="isShowSclBeforeResultPageXgMbtiNormal">
			<SclBeforeResultPageTypeNormalXgMBTI :referenceList="referenceList" :sclInfo="detail" :qstnNum="compQstnNum"
				:sclPayBack="isSclPayBack" @payOk="payMultiXgOk" :scrollTopNum="scrollTopNum" :sclId="sclId" />
		</view>
		<view v-else-if="isShowSclBeforeResultPageCrylNormal">
			<SclBeforeResultPageTypeNormalCRYL :sclInfo="detail" :sclPayBack="isSclPayBack"
				@payOk="toResultPageHandle(true)" :scrollTopNum="scrollTopNum" :sclId="sclId" />
		</view>

		<view v-else-if="isShowSclBeforeResultPageA0">
			<SclBeforeResultPageTypeMBTI :sclPayBack="isSclPayBack" @payOk="toResultPageHandle(true)"
				:goodsGroup="goodsGroupArr" :scrollTopNum="scrollTopNum" :sclId="sclId" />
		</view>
		<view v-else-if="isShowSclBeforeResultPageA1">
			<SclBeforeResultPageTypeSPM :sclPayBack="isSclPayBack" @payOk="toResultPageHandle(true)"
				:goodsGroup="goodsGroupArr" :scrollTopNum="scrollTopNum" :sclId="sclId" />
		</view>
		<view v-else-if="isShowSclBeforeResultPageCommon">
			<SclBeforeResultPageTypeCommon :homeModalType="homeModalType" :showBeforeBtnBackHome="showBeforeBtnBackHome"
				:sclName="loadPageTit" :sclIntro="sclIntro" :referenceList="referenceList" :sclPayBack="isSclPayBack"
				@payOk="toResultPageHandle(true)" :goodsGroup="goodsGroupArr" :scrollTopNum="scrollTopNum"
				:sclId="sclId" />
		</view>
		<view v-else-if="isShowSclBeforeResultPageTypeNormal">
			<SclBeforeResultPageTypeNormal :homeModalType="homeModalType" :sclInfo="detail" :couponInfo="couponInfo"
				:sclName="loadPageTit" :sclIntro="sclIntro" :referenceList="referenceList" :sclPayBack="isSclPayBack"
				@payOk="toResultPageHandle(true)" :scrollTopNum="scrollTopNum" :sclId="sclId" />
		</view>
		<!--颜色性格-->
		<view v-else-if="isShowSclBeforeResultPageTypeFpacpt">
			<SclBeforeResultPageTypeFpacpt :sclInfo="detail" :couponInfo="couponInfo" :sclName="loadPageTit"
				@payOk="toResultPageHandle(true)" :sclId="sclId" />
		</view>
		<!--动物森林-->
		<view v-else-if="isShowSclBeforeResultPageTypeAnimalForest">
			<SclBeforeResultPageTypeAnimalForest :sclInfo="detail" :couponInfo="couponInfo" :sclName="loadPageTit"
				@payOk="toResultPageHandle(true)" :sclId="sclId" />
		</view>
		<!--BEST性格-->
		<view v-else-if="isShowSclBeforeResultPageTypeBestxg">
			<SclBeforeResultPageTypeBestxg :sclInfo="detail" :couponInfo="couponInfo" :sclName="loadPageTit"
				@payOk="toResultPageHandle(true)" :sclId="sclId" />
		</view>
		<view v-else-if="isShowSclBeforeResultPageTypeGoddess">
			<SclBeforeResultPageTypeGoddess :sclInfo="detail" :couponInfo="couponInfo" :sclName="loadPageTit"
				@payOk="toResultPageHandle(true)" :sclId="sclId" />
		</view>
		<view v-else-if="isShowSclBeforeResultPageTypeMailLun">
			<SclBeforeResultPageTypeMaiLun :sclInfo="detail" :couponInfo="couponInfo" :sclName="loadPageTit"
				@payOk="toResultPageHandle(true)" :sclId="sclId" />
		</view>
		<view v-else-if="isShowSclBeforeResultPageTypeQueen">
			<SclBeforeResultPageTypeQueen :sclInfo="detail" :couponInfo="couponInfo" :sclName="loadPageTit"
				@payOk="toResultPageHandle(true)" :sclId="sclId" />
		</view>
		<view v-else-if="isShowEndPage" :style="[{ 'background-image': `url(${staticImgs.fullPageImg})` }]"
			class="question-fill-end-page">
			<template v-if="beforeEndPageBtnOpt.img">
				<view class="before-end-btn-wrapper" :style="{ bottom: beforeEndPageBtnOpt.wrapperBottom }"
					@click="toResultPageHandle()">
					<view class="before-end-intro-btn-inner">
						<view
							:style="{width: beforeEndPageBtnOpt.style.width,height: beforeEndPageBtnOpt.style.height}">
							<image style="width: 100%; height: 100%" :src="beforeEndPageBtnOpt.img"></image>
						</view>

						<view class="before-end-price-wrapper price-wrapper"
							:style="[{ 'background-image': `url(${beforeEndPageBtnOpt.priceBg})` }]">
							<template v-if="currentPrice == 0">
								<text>限时免费</text>
							</template>
							<template v-else>
								<template v-if="detail.discountType">
									<text style="margin-left: 12rpx; font-size: 26rpx">
										<text class="price-icon">¥</text>
										<text>{{ currentPrice }}</text>
										<text style="margin: 0 10rpx">券后</text>
										<text class="price-icon">¥</text>
										<text>{{ viewPrice }}</text>
									</text>
								</template>
								<template v-else>
									<text class="current-price-icon">¥</text>
									<text class="current-price-text">{{ viewPrice }}</text>
								</template>
							</template>
						</view>

						<view class="before-end-to-home-wrapper" @click.stop="toHomePage">
							穿越寻找更多测评
						</view>

						<image class="hand-img loop-pointer" :src="staticImgs.handPointer" mode=""></image>
					</view>
				</view>
			</template>
			<template v-else>
				<view class="tip-wrapper" v-if="isShowEndTip">
					<image class="img" :src="staticImgs.fullPageImgTip" mode=""></image>
				</view>

				<view class="btn-wrapper" :style="{ bottom: styleBottomObj.btnWrapper }" @click="toResultPageHandle()">
					<view class="btn-inner-wrapper">
						<image class="main-img" :class="{ 'main-img-2': isFullType2 }" :src="staticImgs.fullPageImgBtn"
							mode="">
						</image>
						<image class="img loop-pointer" :class="{ 'img-2': isFullType2 }" :src="staticImgs.handPointer"
							mode="">
						</image>
					</view>
				</view>

				<view class="price-wrapper price-wrapper-pos" :style="{ bottom: styleBottomObj.priceWrapper }">
					<template v-if="currentPrice == 0">
						<text>限时免费</text>
					</template>
					<template v-else>
						<template v-if="detail.discountType">
							<text style="margin-left: 12rpx; font-size: 26rpx">优惠价<text
									style="margin: 0 10rpx">券后</text><text
									class="price-icon">¥</text>{{ viewPrice }}</text>
						</template>
						<template v-else>
							<text class="current-price-icon">¥</text>
							<text class="current-price-text">{{ viewPrice }}</text>
						</template>
					</template>
				</view>
			</template>
		</view>

		<GiftModal @confirm="confirmGiftModalHandle" :visible="giftModalVisible" />

		<YiyuanDiscountModal @confirm="confirmGiftModalHandle" :visible="yiyuanDiscountModalVisible" />

		<BeforeExitPageModal :type="doModalType" @confirm="this.beforeExitPageModalVisible = false" @close="toHomePage"
			:visible="beforeExitPageModalVisible" />

		<template v-if="doModalType == 'mbti' || doModalType == 'spm'">
			<ReloadSclHistoryMbtiModal :percent="percent" @confirm="reloadHistroyReportHandle"
				@close="reloadHistoryRetestHandle" :visible="reloadHistoryVisible" />
		</template>
		<template v-else-if="doModalType == 'xg-mbti'">
			<ReloadSclHistoryXgMbtiModal :percent="percent" @confirm="reloadHistroyReportHandle"
				@close="reloadHistoryRetestHandle" :visible="reloadHistoryVisible" />
		</template>
		<template v-else-if="doModalType">
			<ReloadSclHistoryCommonModal :doModalType="doModalType" :percent="percent"
				@confirm="reloadHistroyReportHandle" @close="reloadHistoryRetestHandle"
				:visible="reloadHistoryVisible" />
		</template>
		<template v-else>
			<ReloadSclHistoryModal :percent="percent" @confirm="reloadHistroyReportHandle"
				@close="reloadHistoryRetestHandle" :visible="reloadHistoryVisible" />
		</template>

		<ModalDone ref="modalDone" @leftClick="doneLeftClickHandle" @rightClick="doneRightClickHandle" />

		<DoneQuestionModal ref="doneQuestionModal" @btnClick="doneQuestionModalHandle" />

		<payAfterContinueModal ref="payAfterContinueModal" />
	</view>
</template>

<script>
	import {
		qstnShow,
		userWebAnswer,
		get_scl_info,
		orderPay,
		checkUserIsPayScl,
		isEshopScl,
		updateSclBuyNum,
		saveOptnSubjectivity
	} from '@/common/api/scl_api.js'
	import {
		isPaychakraScl
	} from '@/common/api/index_api.js'
	import {
		getIsNextCouponIsYiyuan
	} from '@/common/api/user_api.js'

	import {
		mapState,
		mapGetters
	} from 'vuex'
	import {
		debounce
	} from 'lodash'
	import {
		removeEmptyProperty,
		calculateDiscountedPrice
	} from '@/common/utils/util.js'

	import navigationBar from "@/components/navigationBar/navigationBar.vue";
	import GiftModal from '@/subcontractorD/components/GiftModal.vue'
	import YiyuanDiscountModal from '@/components/YiyuanDiscountModal.vue'

	import SclBeforeResultLoadPage from '@/subcontractorD/components/SclBeforeResultLoadPage.vue';
	import SclBeforeResultLoadPageMaiLun from '@/subcontractorD/components/SclBeforeResultLoadPageMaiLun.vue'

	import SclBeforeResultPageTypeMBTI from '@/subcontractorD/components/SclBeforeResultPageTypeMBTI.vue'
	import SclBeforeResultPageTypeNormalJobMBTI from '@/subcontractorD/components/SclBeforeResultPageTypeNormalJobMBTI.vue'
	import SclBeforeResultPageTypeCheckup from '@/subcontractorD/components/SclBeforeResultPageTypeCheckup.vue'
	import SclBeforeResultPageTypeCommonJobMBTI from '@/subcontractorD/components/SclBeforeResultPageTypeCommonJobMBTI.vue'
	import SclBeforeResultPageTypeNormalLoveMBTI from '@/subcontractorD/components/SclBeforeResultPageTypeNormalLoveMBTI.vue'
	import SclBeforeResultPageTypeCommonLoveMBTI from '@/subcontractorD/components/SclBeforeResultPageTypeCommonLoveMBTI.vue'
	import SclBeforeResultPageTypeCommonIqSPM from '@/subcontractorD/components/SclBeforeResultPageTypeCommonIqSPM.vue'
	import SclBeforeResultPageTypeCommonEqTMMS from '@/subcontractorD/components/SclBeforeResultPageTypeCommonEqTMMS.vue'
	import SclBeforeResultPageTypeCommonXgMBTI from '@/subcontractorD/components/SclBeforeResultPageTypeCommonXgMBTI.vue'

	import SclBeforeResultPageTypeCommonCRYL from '@/subcontractorD/components/SclBeforeResultPageTypeCommonCRYL.vue'
	import SclBeforeResultPageTypeNormalCRYL from '@/subcontractorD/components/SclBeforeResultPageTypeNormalCRYL.vue'

	import SclBeforeResultPageTypeNormalIqSPM from '@/subcontractorD/components/SclBeforeResultPageTypeNormalIqSPM.vue'

	import SclBeforeResultPageTypeNormalEqTMMS from '@/subcontractorD/components/SclBeforeResultPageTypeNormalEqTMMS.vue'
	import SclBeforeResultPageTypeNormalXgMBTI from '@/subcontractorD/components/SclBeforeResultPageTypeNormalXgMBTI.vue'
	import SclBeforeResultPageTypeSPM from '@/subcontractorD/components/SclBeforeResultPageTypeSPM.vue'
	import SclBeforeResultPageTypeCommon from '@/subcontractorD/components/SclBeforeResultPageTypeCommon.vue'
	import SclBeforeResultPageTypeNormal from '@/subcontractorD/components/SclBeforeResultPageTypeNormal.vue'

	import ReloadSclHistoryModal from '@/subcontractorD/components/ReloadSclHistoryModal.vue'
	import ReloadSclHistoryMbtiModal from '@/subcontractorD/components/ReloadSclHistoryMbtiModal.vue'
	import ReloadSclHistoryXgMbtiModal from '@/subcontractorD/components/ReloadSclHistoryXgMbtiModal.vue'
	import ReloadSclHistoryCommonModal from '@/subcontractorD/components/ReloadSclHistoryCommonModal.vue'

	import BeforeExitPageModal from './BeforeExitPageModal.vue'
	import sclDoQuesitonAboutMbti from './scl-do-quesiton-about-mbti.vue'
	import sclDoQuesitonAboutIq from './scl-do-question-about-iq.vue'
	import sclDoQuesitonAboutEq from './scl-do-question-about-eq.vue'
	import sclDoQuesitonAboutCRYL from './scl-do-question-about-cryl.vue'
	import sclDoQuesitonAboutQX from './scl-do-question-about-qx.vue'
	import sclDoQuesitonAboutMaiLun from './scl-do-question-about-mailun.vue'
	import sclDoQuesitonAboutDongWuLianAi from './scl-do-question-about-dongwulianai.vue'
	import sclDoQuesitonAboutFpacpt from './scl-do-question-about-fpacpt.vue'
	import sclNoticePage from './scl-notice-page.vue'
	import sclNoticePageAboutJobMBTI from './scl-notice-job-mbti-page.vue'
	import sclNoticePageAboutLoveMBTI from './scl-notice-love-mbti-page.vue'
	import sclNoticePageAboutXgMBTI from './scl-notice-xg-mbti-page.vue'
	import sclNoticePageAboutEqTMMS from './scl-notice-eq-tmms-page.vue'
	import sclNoticePageAboutCRYL from './scl-notice-cryl-page.vue'
	import sclNoticeIqPage from './scl-notice-iq-page.vue'
	import ModalDone from "./modal-done.vue"
	import DoneQuestionModal from './done-question-modal.vue'
	import payAfterContinueModal from './payAfterContinueModal.vue'
	import SclBeforeResultPageTypeFpacpt from '@/subcontractorD/components/SclBeforeResultPageTypeFpacpt.vue'
	import sclNoticePageAboutAnimalForest from './scl-notice-animal-forest.vue'
	import sclDoQuestionAboutAnimalForest from './scl-do-question-about-animal-forest.vue'
	import SclBeforeResultPageTypeAnimalForest from '@/subcontractorD/components/SclBeforeResultPageTypeAnimalForest.vue'
	import sclNoticePageAboutBestxg from './scl-notice-bestxg.vue'
	import sclNoticePageAboutGoddess from './scl-notice-goddess.vue'
	import sclDoQuestionAboutBestxg from './scl-do-question-about-bestxg.vue'
	import SclBeforeResultPageTypeBestxg from '@/subcontractorD/components/SclBeforeResultPageTypeBestxg.vue'
	import SclBeforeResultPageTypeGoddess from '@/subcontractorD/components/SclBeforeResultPageTypeGoddess.vue'
	import SclBeforeResultPageTypeMaiLun from '@/subcontractorD/components/SclBeforeResultPageTypeMaiLun.vue'
	import SclBeforeResultPageTypeQueen from '@/subcontractorD/components/SclBeforeResultPageTypeQueen.vue'
	import SclDoQuestionAboutQueen from './scl-do-question-about-queen.vue'


	let clockTimer = null
	export default {
		components: {
			navigationBar,
			GiftModal,
			YiyuanDiscountModal,
			SclBeforeResultLoadPage,
			SclBeforeResultPageTypeMBTI,
			SclBeforeResultPageTypeSPM,
			SclBeforeResultPageTypeCommon,
			ReloadSclHistoryModal,
			ReloadSclHistoryMbtiModal,
			ReloadSclHistoryXgMbtiModal,
			BeforeExitPageModal,
			SclBeforeResultPageTypeNormal,
			sclDoQuesitonAboutMbti,
			payAfterContinueModal,
			SclBeforeResultPageTypeNormalJobMBTI,
			SclBeforeResultPageTypeCommonJobMBTI,
			SclBeforeResultPageTypeNormalLoveMBTI,
			SclBeforeResultPageTypeCommonLoveMBTI,
			sclDoQuesitonAboutIq, //:'scl-do-question-about-iq'
			SclBeforeResultPageTypeCommonIqSPM,
			sclDoQuesitonAboutEq,
			SclBeforeResultPageTypeNormalIqSPM,
			SclBeforeResultPageTypeCommonEqTMMS,
			SclBeforeResultPageTypeNormalEqTMMS,
			SclBeforeResultPageTypeCheckup,
			sclNoticePage,
			sclNoticeIqPage,
			sclNoticePageAboutJobMBTI,
			sclNoticePageAboutLoveMBTI,
			sclNoticePageAboutEqTMMS,
			sclNoticePageAboutXgMBTI,
			SclBeforeResultPageTypeNormalXgMBTI,
			SclBeforeResultPageTypeCommonXgMBTI,
			sclNoticePageAboutCRYL,
			ReloadSclHistoryCommonModal,
			sclDoQuesitonAboutCRYL,
			SclBeforeResultPageTypeNormalCRYL,
			SclBeforeResultPageTypeCommonCRYL,
			ModalDone,
			DoneQuestionModal,
			sclDoQuesitonAboutQX,
			sclDoQuesitonAboutDongWuLianAi,
			sclDoQuesitonAboutFpacpt,
			SclBeforeResultPageTypeFpacpt,
			sclNoticePageAboutAnimalForest,
			sclDoQuestionAboutAnimalForest,
			SclBeforeResultPageTypeAnimalForest,
			sclNoticePageAboutBestxg,
			sclDoQuestionAboutBestxg,
			SclBeforeResultPageTypeBestxg,
			sclNoticePageAboutGoddess,
			SclBeforeResultPageTypeGoddess,
			SclBeforeResultPageTypeQueen,
			sclDoQuesitonAboutMaiLun,
			SclBeforeResultLoadPageMaiLun,
			SclDoQuestionAboutQueen,
			SclBeforeResultPageTypeMaiLun
		},
		data() {
			return {
				isPageLoad: true,
				navigationBarDataInfo: {
					"bg_color": "#fff",
					"color": "#333",
					"flag": 1,
					"name": "测一测",
					"hasEntity": true,
				},
				skipValidationFieldId: '9c423ad27f2e4af79a52c02d72d3721a', //该问题主观题输入框不需要进行校验；
				currentInputCon: '',
				isSclPayBack: true,
				questionAnswer: [],
				sclIntro: '',
				actGroup: 'all',
				referenceList: [],
				questionList: null,
				currentIndex: 0,
				percent: 0,
				startTime: new Date().getTime(), //记录测评开始时间
				doQuestionNum: 0,
				loadPageTit: '',
				paramObj: null, //测评对象 userType    sclId
				staticImgs: {
					bg: this.imgBaseURL + '/scl/scl_do_bg.png',
					btnBg: this.imgBaseURL + '/scl/scl_do_btn_bg_1.png',
					progressBg: this.imgBaseURL + '/scl/scl_do_progress_bg.png',
					progressBgFlash: this.imgBaseURL + '/scl/flash.png',
					fullPageBg: this.imgBaseURL + '/scl/result/fanhuaMBTI/do-question-bg.png',
					fullPageImg: this.imgBaseURL + '/scl/result/fanhuaMBTI/result-before-pay-bg.png',
					fullPageImgTip: this.imgBaseURL + '/scl/result/fanhuaMBTI/result-before-pay-tip.png',
					fullPageImgBtn: this.imgBaseURL + '/scl/result/fanhuaMBTI/result-before-pay-btn.png',
					handPointer: this.imgBaseURL + '/scl/result/fanhuaMBTI/hand-pointer.png',
					bgA: this.imgBaseURL + '/scl/question-page-bg.png',
					chatImg: this.imgBaseURL + '/scl/chat.png',
					giftImg: this.imgBaseURL + '/scl/gift.png',
					clockImg: this.imgBaseURL + '/scl/clock.png',
					yiyuanImg: this.imgBaseURL + '/scl/yiyuan-modal/yiyuan-icon.png',
					yiyuanChatImg: this.imgBaseURL + '/scl/yiyuan-modal/yiyuan-dialog.png',
					noticePageBg_SPM: this.imgBaseURL + '/scl/question-page/iq-spm/notice-page-bg.jpg',
					noticePageBtn_SPM: this.imgBaseURL + '/scl/question-page/iq-spm/notice-page-btn.png',
					depressedBg: this.imgBaseURL + '/scl/question-page-depressed-bg.png',
					sexualityBg: this.imgBaseURL + '/scl/question-page-sexuality-bg.png',
					goddessBg: this.imgBaseURL + '/scl/question-page/goddess/goddessBg.png',
					mentalHealthBg: this.imgBaseURL + '/scl/question-page-mental-health-bg.png',
					mentalHealthProgressBg: this.imgBaseURL + '/scl/mental-health-flash.png',
					depressedProgressBg: this.imgBaseURL + '/scl/depressed-flash.png',
					sexualityProgressBg: this.imgBaseURL + '/scl/sexuality-flash.png',
					goddessProgressBg: this.imgBaseURL + '/scl/question-page/goddess/goddess-flash.png',
					sexualityPrevImg: this.imgBaseURL + '/scl/sexuality-prev-btn.png',
					sexualityDirectoryImg: this.imgBaseURL + '/scl/sexuality-directory-btn.png',
					sexualityNextImg: this.imgBaseURL + '/scl/sexuality-next-btn.png',
					sexualitySubmitImg: this.imgBaseURL + '/scl/sexuality-submit-btn-v2.png',
					queenBg: this.imgBaseURL + '/scl/question-page/queen/bg.png',
					queenProgressBg: this.imgBaseURL + '/scl/question-page/queen/progress.png'
				},
				shareData: {
					title: '万心测心理为您的心理健康保驾护航',
					path: '/pages/index/index',
					imageUrl: this.imgBaseURL + '/img_index_share_yu_yue.jpg?' + Math.random(),
					desc: '',
					content: ''
				},
				renderOpts: true,
				countTime: '00:00',
				startDateTime: null,
				isFullPage: false, //为真时，在最后提交时需判断是否已购买
				sclId: '',
				localAnswer: null,
				isSclNotFreeAndNotOwned: false, //当前测评不是免费的且不未购买过
				detail: null,
				isShowEndPage: false,
				styleBottomObj: {
					priceWrapper: 0,
					btnWrapper: 0,
					tipWrapper: 0,
				},
				currentPrice: 0,
				discountedPrice: 0,
				checkFullPageOk: false,
				isAfterPay: false,
				discountPriceE: 0,
				couponModalActE: false, //是否在取消支付时弹出二次阻拦
				couponModalVisibleE: false, //二次阻拦优惠券弹窗
				fullType: '', //'fanhua' , 'x02'
				// showDiscount:false,
				showFullPageAlert: false,
				isShowGiftAbs: false,
				giftModalVisible: false,
				animationFlag: false,
				isShowYiyuanAbs: false,
				yiyuanDiscountModalVisible: false,
				endPageType: '',
				checkupTip: '',
				/**
				 * 后支付的测评都有单独的页面，如果该值为空
				 * 且isShowEndPage为true的话，则该测评应该是全屏的特殊测评，不然会出错...
				 */
				isShowSclBeforeResultLoadPage: false,
				showMainPage: true,
				goodsGroupArr: [],
				scrollTopNum: 0,
				reloadHistoryVisible: false,
				closeAdditional: false,
				isFromCheckUp: false,
				isScl90: false,
				isSclAllReport: '', //Y/N 是否是简版scl90结果
				beforeEndPageBtnOpt: {
					img: '',
					priceBg: '',
					wrapperBottom: '0',
					style: {}
				},
				beforeExitPageModalVisible: false,
				reloadInputBox: false,
				homeModalType: '',
				showBeforeBtnBackHome: false,
				lastIndex: 0,
				questionPageType: '',
				noticePage: '',
				doModalType: '',
				directoryType: '',
				useExitBlocker: false,
				showCheckupPrice: false,
				addSclWay: '',
				qstnNum: null,
				compQstnNum: null,
				needBlockMulti: true,
				latestEndPageType: '',
				initialPriceListObj: {},
				introType: '', //introType=='32-multi-mbti'
				moreAnswer: null,
				doQuestionType: '', //jump 为空则默认是正常做题类型
				indexSelectDc: 0,
				oldCurrentIndex: null,
				hasOwn: false,
				submitLoding: false,
				questionListShow: false,
				dialogText: '',
				jumpType: '' //跳过来的是那种测评
			}
		},
		watch: {
			latestEndPageType(val) {
				console.log(val, '--------latestEndPageType------')
			},
			animationFlag(val) {
				if (val) {
					setTimeout(() => {
						this.animationFlag = false
						this.giftModalVisible = true
					}, 1500)
				}
			},
			currentIndex(val, old) {
				if (val) {
					this.renderOpts = false
					this.$nextTick(() => {
						this.renderOpts = true
					})
				}
			},
			isShowEndPage(val) {
				if (val) {
					this.$u.api.addLog({
						sclId: this.sclId,
						sourseType: 15
					})
				}
			},
			currentInputCon(val) {
				if (val == '') {
					this.$refs?.sclDoQuesitonAboutIq?.clearInput()
				}
			}
		},
		onPageScroll(e) {
			this.scrollTopNum = e.scrollTop
		},
		computed: {
			...mapGetters('user', ['isLogin', 'discountE', 'discountYiYuan', 'userId']),
			...mapState({
				notUseLbYiyuan: state => state.user.notUseLbYiyuan,
				currentGroup: state => state.user.currentGroup,
				discountId: state => state.user.discountId,
				discountNum: state => state.user.discountNum,
				discountType: state => state.user.discountType,
				purchaseAndUsageCount: state => state.user.purchaseAndUsageCount,
				isPaySclExamination: state => state.user.isPaySclExamination, //是否已购买测评体检包
				isPaySclExamination: state => state.user.isPaySclExamination, //是否已购买测评体检包
			}),
			couponInfo() {
				return {
					id: this?.detail?.discountUid,
					discount: this?.detail?.discountNum,
					type: this?.detail?.discountType,
					notUseLbYiyuan: this.notUseLbYiyuan
				}
			},
			isShowQuestionPage() {
				return this.questionList && !this.isShowEndPage && this.showMainPage
			},
			isShowSclBeforeResultPageA0() {
				return this.isShowEndPage && this.endPageType == 'A0'
			},
			isShowSclBeforeResultPageA1() {
				return this.isShowEndPage && this.endPageType == 'A1'
			},
			isShowSclBeforeResultPageJobMbtiNormal() {
				return this.isShowEndPage && this.endPageType == 'job-mbti-normal'
			},
			isShowSclBeforeResultPageJobMbtiCommon() {
				return this.isShowEndPage && this.endPageType == 'job-mbti-common'
			},
			isShowSclBeforeResultPageLoveMbtiNormal() {
				return this.isShowEndPage && this.endPageType == 'love-mbti-normal'
			},
			isShowSclBeforeResultPageXgMbtiCommon() {
				return this.isShowEndPage && (this.endPageType == 'xg-mbti-common' || this.latestEndPageType ==
					'xg-mbti-common')
			},
			isShowSclBeforeResultPageCrylCommon() {
				return this.isShowEndPage && this.endPageType == 'love-cryl-common'
			},
			isShowSclBeforeResultPageIqSpmCommon() {
				return this.isShowEndPage && this.endPageType == 'iq-spm-common'
			},
			isShowSclBeforeResultPageIqSpmNormal() {
				return this.isShowEndPage && this.endPageType == 'iq-spm-normal'
			},
			isShowSclBeforeResultPageCheckup() {
				return this.isShowEndPage && (this.endPageType == 'checkup' || (this.endPageType == 'checkup-normal' &&
					this.isFromCheckUp))
			},
			isShowSclBeforeResultPageEqTmmsCommon() {
				return this.isShowEndPage && this.endPageType == 'eq-tmms-common'
			},
			isShowSclBeforeResultPageEqTmmsmNormal() {
				return this.isShowEndPage && this.endPageType == 'eq-tmms-normal'
			},
			isShowSclBeforeResultPageXgMbtiNormal() {
				return this.isShowEndPage && (this.endPageType == 'xg-mbti-normal' || this.latestEndPageType ==
					'xg-mbti-normal')
			},
			isShowSclBeforeResultPageCrylNormal() {
				return this.isShowEndPage && this.endPageType == 'love-cryl-noraml'
			},
			isShowSclBeforeResultPageCommon() {
				return this.isShowEndPage && this.endPageType == 'common'
			},
			isShowSclBeforeResultPageTypeNormal() {
				return this.isShowEndPage && this.endPageType == 'normal' || (this.endPageType == 'checkup-normal' && !this
					.isFromCheckup)
			},
			isShowSclBeforeResultPageTypeFpacpt() {
				return this.isShowEndPage && this.endPageType == 'fpacpt'
			},
			isShowSclBeforeResultPageTypeAnimalForest() {
				return this.isShowEndPage && this.endPageType == 'animalforest'
			},
			isShowSclBeforeResultPageTypeBestxg() {
				return this.isShowEndPage && this.endPageType == 'bestxg'
			},
			isShowSclBeforeResultPageTypeGoddess() {
				return this.isShowEndPage && this.endPageType == 'goddess'
			},
			isShowSclBeforeResultPageTypeMailLun() {
				return this.isShowEndPage && this.endPageType == 'mailun'
			},
			isShowSclBeforeResultPageTypeQueen() {
				return this.isShowEndPage && this.endPageType == 'queen'
			},
			viewPrice() {
				return this.detail?.discountType ? this.discountedPrice : this.currentPrice
			},
			computedBgStyle() {
				if (this.isFullPage && this.fullType != 'x06') {
					return `url(${this.staticImgs.fullPageBg})`
				} else {
					switch (this.containerClassName) {
						case 'mentalHealth':
							// 个人体检
							return `url(${this.staticImgs.mentalHealthBg})`
						case 'depressed':
							// 抑郁包
							return `url(${this.staticImgs.depressedBg})`
						case 'sexuality':
							// 性取向
							return `url(${this.staticImgs.sexualityBg})`
						case 'goddess':
							//女神节
							return `url(${this.staticImgs.goddessBg})`
						case 'queen':
							//女神节
							return `url(${this.staticImgs.queenBg})`
						default:
							return `url(${this.staticImgs.bgA})`
					}
				}
			},
			isShowEndTip() {
				return this.fullType != 'x02' && this.fullType != 'x03'
			},
			isFullType2() {
				return this.fullType == 'x02' || this.fullType == 'x03'
			},
			showPreBtn() {
				return this.doQuestionType != 'jump' ||
					(this.doQuestionType == 'jump' && this.oldCurrentIndex !== null && (this.oldCurrentIndex != this
						.currentIndex))
			},
			containerClassName() {
				switch (this.paramObj?.sclReportType) {
					case 1:
						// 个人体检
						return 'mentalHealth'
					case 2:
						// 抑郁包
						return 'depressed'
					case 3:
						// 性取向
						return 'sexuality'
					default:
						if (this.questionPageType == 'goddess') {
							return 'goddess'
						} else if (this.questionPageType == 'queen') {
							return 'queen'
						}
						return ''
				}
			},
			// 进度背景
			progressBgFlashImg() {
				switch (this.containerClassName) {
					case 'mentalHealth':
						// 个人体检
						return {
							img: this.staticImgs.mentalHealthProgressBg,
								progressColor: '#6BC0E9',
								gradualColor: '#FFFFFF'
						}
					case 'depressed':
						// 抑郁包
						return {
							img: this.staticImgs.depressedProgressBg,
								progressColor: '#1FB6CA',
								gradualColor: '#2DD8E9'
						}
					case 'sexuality':
						// 性取向
						return {
							img: this.staticImgs.sexualityProgressBg,
								progressColor: '#3486F6',
								gradualColor: '#004BA4'
						}
					case 'goddess':
						// 女神节
						return {
							img: this.staticImgs.goddessProgressBg,
								progressColor: '#F1AFB8',
								gradualColor: '#F37485'
						}
					case 'queen':
						// 女王
						return {
							img: this.staticImgs.queenProgressBg,
								progressColor: '#F1AFB8',
								gradualColor: '#F37485'
						}
					default:
						return {
							img: this.staticImgs.progressBgFlash,
								progressColor: '#5CBD44',
								gradualColor: '#5CBD44'
						}
				}
			}
		},
		onLoad(options) {
			this.questionListShow = false
			this.isPageLoad = true
			console.log(options, '======options')

			if (!options.paramObj) {
				options.paramObj = JSON.stringify({
					sclId: options.sclId,
					isFullPage: options.isFullPage || false,
				})
			}
			uni.setStorageSync('from', 'afterPayScl90Page')
			this.paramObj = JSON.parse(options.paramObj);
			this.jumpType = this.paramObj.jumpType;

			if (this.paramObj.reportId || this.paramObj.from) {
				this.showFullPageAlert = false
			}

			this.hasOwn = this.paramObj.hasOwn
			this.isFullPage = this.paramObj.isFullPage
			this.sclId = this.paramObj.sclId
			this.qstnNum = this.paramObj.qstnCode || ''
			this.compQstnNum = this.qstnNum
			this.isFromCheckUp = this.paramObj.sclReportType == 1
			this.showCheckupPrice = this.paramObj.showCheckupPrice

			this.startDateTime = this.$dayjs()

			this.initStyle()
			this.initQeustion(this.sclId)

			uni.$on('updateDirectoryIndex', (res) => {
				this.currentIndex = res.index;
			})
			uni.$on('submitQuestion', () => {
				this.currentIndex = this.questionList.length - 1
				this.nextQuestion()
			})
		},
		onUnload() {
			uni.$off('updateDirectoryIndex')
			uni.$off('submitQuestion')
			if (clockTimer) {
				clearInterval(clockTimer)
			}
		},
		methods: {
			jumpQuestionHandle() {
				console.log(this.currentIndex, '-----this.currentIndex')
				this.setQuestionAndAnswerToLocal()

				const qst = this.questionList[this.currentIndex]
				const opt = qst.optnList[this.indexSelectDc]

				console.log('qst：', qst)
				console.log('opt：', opt)

				if (opt.outType == '2') {
					console.log(this.isSclNotFreeAndNotOwned, '-1');
					console.log(this.isFullPage, '-2');
					console.log(this.checkFullPageOk, '-3');
					console.log(this.isAfterPay, '-4');
					console.log(this.isFromCheckUp, '-5');
					console.log(this.isPaySclExamination, '-6');
					console.log('------------------------------------------------')

					if (
						this.isSclNotFreeAndNotOwned &&
						(
							(this.isFullPage && !this.checkFullPageOk) ||
							(this.isAfterPay && !(this.isFromCheckUp && this.isPaySclExamination)) ||
							(this.paramObj.sclReportType == 3 && !this.paramObj.hasOwn)
						)
					) {

						if (this.endPageType == 'checkup-sexuality') {
							return uni.redirectTo({
								url: '/subcontractorC/pages/sexuality-assessment/payPage?sclId=' + this.sclId +
									`&testDuration=${new Date().getTime() - this.startTime}&userType=${this.paramObj.userType}`
							})
						}

						this.isShowEndPage = true
						this.showMainPage = false
						return false
					}

					//跳转到了结果，进行提交
					if (!this.localAnswer) {
						this.localAnswer = uni.getStorageSync(`sclAnswer-${this.sclId}`)
					}

					this.toResultPageHandle()
				} else {
					console.log(opt.outId, '---opt.outId')

					this.currentIndex = this.questionList.findIndex(item => item.id == opt.outId)
				}
				console.log(this.currentIndex, '---this.currentIndex---')
				// this.questionList = ''
			},
			sclQxNextQuestion(moreAnswer) {
				console.log(moreAnswer, '===moreAnswer===')
				this.moreAnswer = moreAnswer
				uni.setStorageSync('moreAnswer', JSON.stringify(this.moreAnswer))
				this.nextQuestion()
			},
			async doneQuestionModalHandle({
				type,
				qstnNum
			}) {
				console.log(type, qstnNum, '======type======')
				if (type == 'cancel') {
					const pagesArr = getCurrentPages()
					if (pagesArr.length === 1) {
						uni.reLaunch({
							url: '/pages/sclList/sclList'
						})
					} else {
						uni.navigateBack()
					}
					this.compQstnNum = this.qstnNum




				} else if (type == 'ok') {
					if (this.endPageType == '32-multi-mbti-common') {
						this.compQstnNum = qstnNum
						this.isShowEndPage = true
						this.latestEndPageType = 'xg-mbti-common'
						this.$refs.doneQuestionModal.hide()

						const tmpObj = this.initialPriceListObj[this.compQstnNum]
						this.goodsGroupArr = [
							tmpObj.groupA,
							tmpObj.groupB,
						]
						this.sclIntro = tmpObj.intro
					} else if (this.endPageType == '32-multi-mbti-normal') {
						this.compQstnNum = qstnNum
						this.isShowEndPage = true
						this.latestEndPageType = 'xg-mbti-normal'
						this.$refs.doneQuestionModal.hide()
						const res = await get_scl_info(removeEmptyProperty({
							sclId: this.sclId,
							code: this.$store.state.user.actCouponCode,
							qstnNum: this.compQstnNum
						}))
						this.detail = res.data.data || {}


					}
				}


			},
			async payMultiXgOk(params, isDis) {
				console.log(params, isDis, '-----params,isDis----')

				if (params == 'normal') {
					if (this.compQstnNum == 100) {
						this.toResultPageHandle(true)
					} else {
						this.paramObj.reportId = 'not empty'
						this.qstnNum = this.compQstnNum
						uni.showLoading()
						const qstnRes = await qstnShow({
							sclId: this.sclId,
							isPay: (this.isFullPage || this.isAfterPay || this.isFromCheckUp || this?.paramObj
								?.sclReportType == 2 || this?.paramObj?.sclReportType == 3) ? 'N' : 'Y',
							qstnNum: this.compQstnNum
						})

						if (qstnRes.data.code == 2000) {
							this.questionList = qstnRes.data.data;
							this.questionList.forEach((item, index) => {
								item.optHasImg = item.optnList.find((itemOptn) => {
									return itemOptn.optnImg != null && itemOptn.optnImg != ''
								})
							})
						}

						if (!this.localAnswer) {
							this.localAnswer = uni.getStorageSync(`sclAnswer-${this.sclId}`)
						}

						if (this.localAnswer) {
							this.questionAnswer = JSON.parse(this.localAnswer)

							console.log(this.questionAnswer, '----this.questionAnswer---this.questionAnswer')

							this.needBlockMulti = false
							this.initAnswer()
							this.currentIndex = this.lastIndex

							let answerJson = [];
							answerJson = this.processAnswer()

							console.log(answerJson, '-=====answerJson=====')
							this.toSubmit(answerJson)
							// this.getPercent()
						}

					}
				} else if (this.compQstnNum != 100 && isDis != 'Y') {
					if (params == 'groupB') {
						this.latestEndPageType = '32-multi-mbti-common'
						this.isShowEndPage = false
						this.qstnNum = '100'
						this.compQstnNum = this.qstnNum
						this.initQeustion(this.sclId, 'N')
						this.$refs.modalDone.hide()
						this.$refs.payAfterContinueModal.show()
						this.paramObj.reportId = 'not empty'
					} else {

						this.paramObj.reportId = 'not empty'
						this.qstnNum = this.compQstnNum
						uni.showLoading()
						const qstnRes = await qstnShow({
							sclId: this.sclId,
							isPay: (this.isFullPage || this.isAfterPay || this.isFromCheckUp || this?.paramObj
								?.sclReportType == 2 || this?.paramObj?.sclReportType == 3) ? 'N' : 'Y',
							qstnNum: this.compQstnNum
						})

						if (qstnRes.data.code == 2000) {
							this.questionList = qstnRes.data.data;
							this.questionList.forEach((item, index) => {
								item.optHasImg = item.optnList.find((itemOptn) => {
									return itemOptn.optnImg != null && itemOptn.optnImg != ''
								})
							})

							console.log(this.questionAnswer, '-----this.questionAnswer----')
							console.log(this.localAnswer, '3=====this.localAnswer====')

							if (!this.localAnswer) {
								this.localAnswer = uni.getStorageSync(`sclAnswer-${this.sclId}`)
							}

							if (this.localAnswer) {
								this.questionAnswer = JSON.parse(this.localAnswer)

								console.log(this.questionAnswer, '----this.questionAnswer---this.questionAnswer')

								this.needBlockMulti = false
								this.initAnswer()
								this.currentIndex = this.lastIndex

								let answerJson = [];
								answerJson = this.processAnswer()

								console.log(answerJson, '-=====answerJson=====')
								this.toSubmit(answerJson)
								// this.getPercent()
							}

							// this.nextQuestion()
						}




					}

				} else {
					if (isDis == 'Y') {
						let answerJson = [];
						answerJson = this.processAnswer()
						answerJson = answerJson.slice(0, this.compQstnNum)

						console.log(answerJson, '---------answerJson')
						this.localAnswer = JSON.stringify(answerJson)
					}

					this.toResultPageHandle(true)
				}
			},
			doneLeftClickHandle() {
				console.log('doneRightClickHandle')

				this.latestEndPageType = this.endPageType == '32-multi-mbti-common' ? 'xg-mbti-common' : 'xg-mbti-normal'
				this.isShowEndPage = true
				this.$refs.modalDone.hide()
			},
			doneRightClickHandle() {
				console.log('doneRightClickHandle')
				const submitForm = removeEmptyProperty({
					orderType: '7',
					sclId: this.sclId,
					adClickId: uni.getStorageSync('adClickId'),
					qstnNum: '100'
				})
				this.purePayHandle(submitForm, (fRes) => {
					console.log('----付钱结束----', fRes)

					this.qstnNum = '100'
					this.compQstnNum = this.qstnNum
					this.initQeustion(this.sclId, 'N')
					this.$refs.modalDone.hide()
					this.$refs.payAfterContinueModal.show()
					this.paramObj.reportId = 'not empty'
				})
			},
			changeCurrentInput(val) {
				console.log(val, '-------val------')
				this.currentInputCon = val
			},
			inputEventHandle_1(e) {
				//限制最多输入一个中文字符，否则提示
				// 判断输入的字符是否是中文
				const regChinese = /[\u4e00-\u9fa5]/;

				if (!regChinese.test(e) || e.length > 1) {
					this.currentInputCon = ''; // 清空输入内容
					this.reloadInputBox = true; // 触发重新加载输入框
					this.$nextTick(() => {
						this.reloadInputBox = false;
					});

					this.$u.toast('最多只能输入一个中文字符'); // 提示用户
				} else {
					this.currentInputCon = e
				}
			},
			inputEventHandle(e) {
				//只保留数字，如果有非数字的字符，去掉并提示用户
				const reg = /^[0-9]*$/
				if (!reg.test(e)) {
					this.currentInputCon = this.currentInputCon.replace(/\D/g, '')
					this.currentInputCon = ''
					this.reloadInputBox = true
					this.$nextTick(() => {
						this.reloadInputBox = false
					})

					this.$u.toast('请输入数字')
					return
				}

				this.currentInputCon = e

				if (this.currentInputCon > 130 || this.currentInputCon < 1) {
					this.currentInputCon = ''
					this.reloadInputBox = true
					this.$nextTick(() => {
						this.reloadInputBox = false
					})

					this.$u.toast('请输入真实年龄')
				}


				console.log(this.currentInputCon, '====this.currentInputCon')
				console.log('-------inputEventHandle------', e)
			},
			backHandle() {
				console.log('-----back backHandle')
				console.log(this.isShowSclBeforeResultPageA0, '------this.isShowSclBeforeResultPageA0')
				console.log(this.isShowSclBeforeResultPageA1, '------this.isShowSclBeforeResultPageA1')
				console.log(this.qstnNum, '------this.qstnNum-----')
				console.log(this.questionAnswer?.length, '----this.questionAnswer.length')

				const questionAnswer = this.processAnswer()
				console.log(questionAnswer, '------questionAnswer-----')


				if (
					!this.isFromCheckUp &&
					(
						this.endPageType == 'A0' ||
						this.endPageType == 'A1' ||
						this.endPageType == 'common' ||
						this.endPageType == 'job-mbti-normal' ||
						this.endPageType == 'job-mbti-common' ||
						this.endPageType == 'love-mbti-common' ||
						this.endPageType == 'love-mbti-normal'
					) ||
					this.useExitBlocker
				) {
					console.log(this.paramObj, '------this.paramObj-----')
					if (this.qstnNum && questionAnswer.length >= 24 && !this.paramObj.reportId && !this.paramObj.from) {
						console.log(questionAnswer.length, '----this.questionAnswer.length')

						this.$refs.doneQuestionModal.show({
							qstnNum: questionAnswer.length >= 52 ? 52 : 24
						})

					} else {
						this.beforeExitPageModalVisible = true
					}
				} else {
					const pagesArr = getCurrentPages()
					if (pagesArr.length === 1) {
						uni.reLaunch({
							url: '/pages/sclList/sclList'
						})
					} else {
						uni.navigateBack()
					}
				}
			},
			toHomePage() {
				console.log('-------toHomePage-')
				this.beforeExitPageModalVisible = false

				this.setQuestionAndAnswerToLocal()

				if (!this.isFromCheckUp) {
					if (this.endPageType == 'A0' || this.homeModalType == 'MBTI') {
						uni.setStorageSync('mbtiModalVisible', true)
					}
					if (this.endPageType == 'A1' || this.homeModalType == 'SPM') {
						uni.setStorageSync('iqModalVisible', true)
					}

					console.log(this.homeModalType, '========this.homeModalType')
					if (this.homeModalType == 'love-mbti') {
						uni.setStorageSync('loveMbtiModalVisible', true)
					}
				}

				uni.reLaunch({
					url: '/pages/sclList/sclList?userType=sclList'
				})
			},
			initAnswer() {
				this.lastIndex = 0
				let hasAnswer = false
				let hasSetIndex = false
				let firstUnSelect = 0

				if (this.questionAnswer.length > this.questionList.length) {
					this.questionAnswer = this.questionAnswer.slice(0, this.questionList.length)
				}

				this.questionList.forEach((item, index) => {
					let tmpHasAnswer = false
					this.questionAnswer.map((subItem) => {
						if (subItem.qstnId == item.id) {
							tmpHasAnswer = true
							if (!hasSetIndex) {
								this.lastIndex = index
								hasSetIndex = true
							}
							console.log('-----nb------')
							item.optnList.forEach((itemOptn) => {
								if (itemOptn.id == subItem.optnId) {
									itemOptn.select = '1'
								} else {
									itemOptn.select = '0'
								}
							})
						} else if (subItem.sqId === item.id) {
							// 主观题显示
							item.ansOk = true
							item.ansData = subItem.ansDate || ''
							// 主观题判断
							if (item.ansData) {
								tmpHasAnswer = true
							}
						}
					})

					if (!tmpHasAnswer) {
						console.log(index, '============index')
						if (firstUnSelect === 0) {
							firstUnSelect = index
						}
					}


				})

				console.log(this.questionList, '----this.questionList----')
				console.log(this.questionAnswer, '----this.questionAnswer----')

				if (hasAnswer && this.lastIndex == 0) {
					this.lastIndex = this.questionAnswer.length - 1
					console.log('-------hasAnswer')
				} else {
					this.lastIndex = firstUnSelect - 1
					console.log('-------firstUnSelect')
					if (this.lastIndex < 1) {
						this.lastIndex = this.questionAnswer.length - 1
					}
				}

				if (this.doQuestionType == 'jump') {
					const tmpQstnId = this.questionAnswer[this.questionAnswer.length - 1].qstnId
					this.lastIndex = this.questionList.findIndex((item) => item.id == tmpQstnId)
				}

				this.lastIndex = this.lastIndex > 0 ? this.lastIndex : 0

			},
			reloadHistroyReportHandle() {
				this.nextQuestion()
			},
			reloadHistoryRetestHandle() {
				this.questionAnswer = []
				this.currentIndex = 0
				this.questionList.forEach((item, index) => {
					item.optnList.forEach((itemOptn) => {
						itemOptn.select = '0'
					})
				})

				this.moreAnswer = uni.getStorageSync('moreAnswer') ||

					this.getPercent()
			},
			previewImg(img) {
				const imgArr = [img]
				uni.previewImage({
					urls: imgArr,
					current: imgArr[0]
				})
			},
			confirmGiftModalHandle() {
				const arr = this.$SUBSCRIBE_CODES
				const that = this

				uni.getSetting({ //getSetting获取用户的当前设置
					withSubscriptions: true,
					success: res => {
						console.log('res >>>>', res);
						if (res.subscriptionsSetting.mainSwitch &&
							res.subscriptionsSetting &&
							res.subscriptionsSetting[arr[0]] == 'accept' &&
							res.subscriptionsSetting[arr[1]] == 'accept' &&
							res.subscriptionsSetting[arr[2]] == 'accept') {
							that.giftModalVisible = false
							that.yiyuanDiscountModalVisible = false
							that.toSubmit(JSON.parse(that.localAnswer))
						} else {
							uni.requestSubscribeMessage({
								tmplIds: arr,
								success(res) {
									console.log('成功');
									that.giftModalVisible = false
									that.yiyuanDiscountModalVisible = false
									that.toSubmit(JSON.parse(that.localAnswer))
								},
								fail(res) {
									console.log('失败');
									that.giftModalVisible = false
									that.yiyuanDiscountModalVisible = false
									that.toSubmit(JSON.parse(that.localAnswer))
								}
							})
						}
					}
				})


			},
			initStyle() {
				const systemInfo = uni.getSystemInfoSync();
				const safeAreaBottom = systemInfo.safeAreaInsets.bottom
				const bottom72 = this.rpxToPx(72)
				const wHeight = systemInfo.windowHeight

				console.log(wHeight, '====wHeight')
				console.log(bottom72, '=====bottom72')

				if (wHeight > 767) {
					this.styleBottomObj.btnWrapper = (wHeight * 0.23) + bottom72 + 'px'
					this.styleBottomObj.priceWrapper = (wHeight * 0.23) + 'px'
				} else {
					this.styleBottomObj.btnWrapper = (wHeight * 0.06) + bottom72 + 'px'
					this.styleBottomObj.priceWrapper = (wHeight * 0.06) + 'px'
				}
			},
			loadOkHandle() {
				console.log('------loadOkHandle-loadOkHandleloadOkHandle')
				if ((this.endPageType && this.endPageType == 'mailun') || (this.jumpType && this.jumpType == 'mailun')) {
					isPaychakraScl({
						sclId: this.sclId
					}).then(res => {
						res = res.data
						if (res.code == 200 && res.data == 'Y') {
							this.toResultPageHandle(true)
						} else {
							this.isShowEndPage = true
							this.isShowSclBeforeResultLoadPage = false
						}
					})
				} else {
					if (this.endPageType == 'checkup' && this.isScl90 && this.isSclAllReport == 'N') {
						// scl90简版直接跳转
						this.toResultPageHandle(true)
						return false
					} else {
						this.isShowEndPage = true
						this.isShowSclBeforeResultLoadPage = false
					}
				}
			},
			toResultPageHandle(isSkip, actGroup) {
				console.log(actGroup, '-------actGroupactGroupactGroupactGroupactGroup')
				this.actGroup = actGroup
				console.log('最后一个页面了', isSkip)

				console.log(this.isSclNotFreeAndNotOwned, '====this.isSclNotFreeAndNotOwned')
				if (this.isSclNotFreeAndNotOwned && !isSkip) {
					console.log('支付')
					// 进行支付
					this.orderPayHandle()
				} else {
					console.log('提交')
					//提交结果
					this.checkFullPageOk = true
					console.log(this.localAnswer, '1====this.localAnswer===')
					this.toSubmit(JSON.parse(this.localAnswer))
				}
				// if (this.isLogin) {
				// } else {

				// 	uni.redirectTo({
				// 		url: '/subcontractorA/authorization/authorization?paramObj=' +
				// 			JSON.stringify(this.paramObj)
				// 	})
				// }
			},
			loadingOkSubmitResult() {
				this.toSubmit(JSON.parse(this.localAnswer))
			},
			updateSelectSclQuestion(indexSelect, finalData, type = 'autoSelect') {
				console.log(this.currentIndex, '-----this.currentIndex----', indexSelect)
				console.log(this.questionList[this.currentIndex].optnList.length,
					'----this.questionList[this.currentIndex].optnList')
				this.questionList[this.currentIndex].optnList.forEach((item, index) => {
					if (indexSelect == index) {
						item.select = '1'
					} else {
						item.select = '0'
					}
				})
				this.indexSelectDc = indexSelect
				this.$set(this.questionList, this.currentIndex, this.questionList[this.currentIndex]);
				// setTimeout(() => {
				//   console.log('======next=====')

				// }, 60)
				if (finalData) {
					this.sclQxNextQuestion(finalData);
				} else {
					this.nextQuestion(type);
				}
			},
			async initQeustion(sclId, reload) {
				let lastReportAns = null
				if (this.paramObj?.reportId && reload != 'N') {
					const {
						data: res
					} = await this.$u.api.getUserSclAns(removeEmptyProperty({
						reportId: this.paramObj?.reportId
					}))
					lastReportAns = res.data

					console.log(res, '==========res')
				}
				const res = await get_scl_info(removeEmptyProperty({
					sclId: sclId,
					code: this.$store.state.user.actCouponCode,
					qstnNum: this.qstnNum,
					sclType: this.paramObj.sclReportType ? 'Y' : 'N'
				}))
				this.detail = res.data.data || {}
				this.closeAdditional = this.detail.closeAdditional == 'Y'
				const {
					sclName,
					detailImg,
					newOriginalPrice,
					extBuyUse,
					detailInfo,
					scloReportDetail,
					addSclWay
				} = res.data.data
				this.addSclWay = addSclWay
				let tmpObj = {}
				if (detailInfo) {
					//检查是否有跳转规则
					try {
						tmpObj = JSON.parse(detailInfo)
						console.log(tmpObj, 'tmpObj2e23r23234t2424')
					} catch (e) {
						//TODO handle the exception
						tmpObj = {}
					}

					this.introType = tmpObj.introType

					if (tmpObj.questionPage) {
						this.questionPageType = tmpObj.questionPage
						if (this.questionPageType == 'dongwulianai' ||
							this.questionPageType === 'queen' ||
							this.questionPageType === 'fpacpt' ||
							this.questionPageType === 'qx' ||
							this.questionPageType === 'love-mbti' ||
							this.questionPageType === 'job-mbti'
						) {
							this.showFullPageAlert = false;
						}
					}

					if (tmpObj.doQuestionType) {
						this.doQuestionType = tmpObj.doQuestionType
					}

					console.log(this.doQuestionType, '===this.doQuestionType==')

					if (tmpObj.noticePage) {
						this.noticePage = tmpObj.noticePage
					}
					if (tmpObj.directoryType) {
						this.directoryType = tmpObj.directoryType
					}

					this.isScl90 = tmpObj.sclType == 'scl90'
					this.isSclAllReport = tmpObj.isSclAllReport

					if (tmpObj.doModalType) {
						this.doModalType = tmpObj.doModalType
						this.useExitBlocker = true
					}

					this.dialogText = tmpObj.dialogText
				}

				this.shareData.title = sclName
				this.shareData.path = '/pages/index/index?userType=sclShare&sclId=' + sclId
				this.shareData.imageUrl = tmpObj.shareImg || detailImg
				console.log(this.hasOwn, '==this.isPayOk')
				if (!this.hasOwn) {
					this.isSclNotFreeAndNotOwned = newOriginalPrice > 0 && extBuyUse == '1'
				} else {
					this.isSclNotFreeAndNotOwned = false
				}

				this.currentPrice = this.detail.newOriginalPrice
				const tmpSubmitForm = removeEmptyProperty({
					sclId,
					sclType: this.isFromCheckUp || this?.paramObj?.sclReportType == 2 || this?.paramObj
						?.sclReportType == 3 ? 'Y' : null,
				})
				// sclType: this.isFromCheckUp ? 'Y' : null,
				//const {
				//  data: dRes2
				//} = await getIsNextCouponIsYiyuan(tmpSubmitForm)
				//if (dRes2.data && dRes2.data.discountType != 4 && this.detail.newOriginalPrice > 0) {
				//  this.isShowGiftAbs = true
				//} else {
				//  if (dRes2.data?.discountType === 4 && !this.discountYiYuan.isBool) {
				//    this.isShowYiyuanAbs = true
				//  }
				//}

				if (this.detail.discountType) {
					this.discountedPrice = this.detail.discountPrice
					this.discountPriceE = calculateDiscountedPrice(this.discountedPrice, 6)
				} else {
					this.discountPriceE = calculateDiscountedPrice(this.detail.newOriginalPrice, 6)
				}

				if (detailInfo) {
					const tmpObj = JSON.parse(detailInfo)
					console.log(tmpObj, '====tmpObj')
					if (tmpObj.doQuestionBg) {
						this.staticImgs.fullPageBg = tmpObj.doQuestionBg
					}
					if (tmpObj.beforeEndBtnOpt) {
						this.beforeEndPageBtnOpt.img = tmpObj.beforeEndBtnOpt.img
						this.beforeEndPageBtnOpt.wrapperBottom = tmpObj.beforeEndBtnOpt.wrapperBottom
						this.beforeEndPageBtnOpt.style = {
							width: tmpObj.beforeEndBtnOpt.width,
							height: tmpObj.beforeEndBtnOpt.height
						}
					}

					if (tmpObj.sclPayBack) {
						this.isSclPayBack = tmpObj.sclPayBack == 'Y'
					}

					if (tmpObj.priceBg) {
						this.beforeEndPageBtnOpt.priceBg = tmpObj.priceBg
					}
					if (tmpObj.resultBeforePayBtn) {
						this.staticImgs.fullPageImgBtn = tmpObj.resultBeforePayBtn
					}
					if (tmpObj.resultBeforePayBg) {
						this.staticImgs.fullPageImg = tmpObj.resultBeforePayBg
					}
					if (tmpObj.fullType) {
						this.fullType = tmpObj.fullType
					}
					if (tmpObj.handPointImg) {
						this.staticImgs.handPointer = tmpObj.handPointImg
					}
					if (tmpObj.fullShareImg) {
						this.shareData.imageUrl = tmpObj.fullShareImg
					}

					this.isAfterPay = tmpObj.payMode === 'after'
					this.endPageType = tmpObj.endPageType



					this.checkupTip = tmpObj.checkupTip
					this.homeModalType = tmpObj.homeModalType
					this.showBeforeBtnBackHome = tmpObj.homeModalType

					if (tmpObj.priceList) {

						this.sclIntro = tmpObj.paySclDetail
						if (this.qstnNum) {
							this.initialPriceListObj = JSON.parse(JSON.stringify(tmpObj.priceList))
							tmpObj.priceList = tmpObj.priceList[this.qstnNum]
							this.goodsGroupArr = [
								tmpObj.priceList.groupA,
								tmpObj.priceList.groupB,
							]
							this.sclIntro = tmpObj.priceList.intro
						} else {
							this.goodsGroupArr = [
								tmpObj.priceList.groupA,
								tmpObj.priceList.groupB,
							]
						}

					}

					this.loadPageTit = sclName
				}

				if (scloReportDetail) {
					try {
						const mainResultD = JSON.parse(scloReportDetail) || {}
						this.referenceList = mainResultD.reference || mainResultD.literatrue
					} catch (e) {
						//TODO handle the exception
						console.log('parse json has some error mainResultD.')
					}
				}

				const qstnRes = await qstnShow({
					sclId: sclId,
					isPay: (this.isFullPage || this.isAfterPay || this.isFromCheckUp || this?.paramObj
						?.sclReportType == 2 || this?.paramObj?.sclReportType == 3) ? 'N' : 'Y',
					qstnNum: this.qstnNum
				})

				if (qstnRes.data.code == 2000) {
					console.log(this.doQuestionType, ' --- ')
					if (this.doQuestionType == 'jump') {
						this.questionList = qstnRes.data.data.reverse();
						// uni.removeStorageSync(`sclAnswer-${this.sclId}`)
						// this.localAnswer = null
					} else {
						this.questionList = qstnRes.data.data;
					}
					this.questionList.forEach((item, index) => {
						item.optHasImg = item.optnList.find((itemOptn) => {
							return itemOptn.optnImg != null && itemOptn.optnImg != ''
						})
					})

					if (this.paramObj.login && this.isFullPage) {
						//如果是从注册页进入的，且是特殊的全屏测评
						this.isShowEndPage = true
					}

					if (lastReportAns) {
						this.localAnswer = JSON.stringify(lastReportAns)
					} else {
						this.localAnswer = uni.getStorageSync(`sclAnswer-${this.sclId}`)
					}
					console.log(this.localAnswer, '2=====this.localAnswer====')
					if (this.localAnswer) {
						this.questionAnswer = JSON.parse(this.localAnswer)

						console.log(this.questionAnswer, '----this.questionAnswer---this.questionAnswer')

						this.confirmFullTip(!!this.paramObj?.reportId)

						this.initAnswer()

						this.currentIndex = this.lastIndex
						this.getPercent()
						if (this.percent > 0 && reload != 'N' && !this.paramObj?.reportId) {

							if (this.paramObj?.toUnlock) {
								// 如果需要直接解锁
								this.reloadHistroyReportHandle()
							} else {
								setTimeout(() => {
									this.reloadHistoryVisible = true
									this.showFullPageAlert = false
									this.questionListShow = true
									uni.hideLoading()
								}, 500)
							}

						} else {
							this.questionListShow = true
						}

						if (reload == 'N') {
							this.currentIndex = this.currentIndex + 1
						}
					} else {
						this.questionListShow = true
					}

					this.isPageLoad = false

					this.getPercent();
				}
			},
			purePayHandle: debounce(async function(params, afterFn) {
				if (this.pageLoading) {
					return
				}
				let that = this;

				this.pageLoading = true
				const {
					data: tmpRes
				} = await this.$u.api.getWxPayToken({
					sclId: this.sclId
				})
				params.sclPayToken = tmpRes.data
				orderPay(params).then(res => {
					const fRes = res
					if (res.data.code == 200) {
						uni.requestPayment({
							provider: 'wxpay',
							service: 5,
							orderInfo: res.data.data.wr,
							timeStamp: res.data.data.wr.timeStamp,
							nonceStr: res.data.data.wr.nonceStr,
							package: res.data.data.wr.packageValue,
							signType: res.data.data.wr.signType,
							paySign: res.data.data.wr.paySign,
							success: function(res) {
								afterFn(fRes)
								this.pageLoading = false
							},
							fail: function(err) {
								that.$showToast('支付取消');
								this.pageLoading = false
							}
						})
					} else {
						that.$showToast(res.data.message);
						reject()
					}
				}).catch(e => {
					setTimeout(() => {
						this.pageLoading = false
					}, 300)
				})

			}, 500),
			orderPayHandle: debounce(async function(isAdditional) {
				if (this.pageLoading) {
					return
				}

				return new Promise(async (resolve, reject) => {
					let that = this;
					const submitForm = removeEmptyProperty({
						price: this.detail.newOriginalPrice,
						orderType: '7',
						sclId: this.sclId,
						discountUid: isAdditional == 'Y' ? this.discountE.id : (this.$store
							.state.user.actCouponId ||
							this.discountId),
						isAdditional: isAdditional || 'N',
						adClickId: uni.getStorageSync('adClickId'),
					})

					this.pageLoading = true

					const {
						data: tmpRes
					} = await this.$u.api.getWxPayToken({
						sclId: this.sclId
					})
					submitForm.sclPayToken = tmpRes.data
					orderPay(submitForm).then(res => {
						if (res.data.code == 200) {
							uni.requestPayment({
								provider: 'wxpay',
								service: 5,
								orderInfo: res.data.data.wr,
								timeStamp: res.data.data.wr.timeStamp,
								nonceStr: res.data.data.wr.nonceStr,
								package: res.data.data.wr.packageValue,
								signType: res.data.data.wr.signType,
								paySign: res.data.data.wr.paySign,
								success: function(res) {
									that.$store.dispatch(
										'user/getUserDiscountTakeEffect')
									updateSclBuyNum({
										sclId: that.sclId
									})
									that.toResultPageHandle(true)
									this.pageLoading = false
									resolve()
								},
								fail: function(err) {
									that.$showToast('支付取消');
									this.pageLoading = false
									that.paymentCancellationConfirmation()
								}
							});
						} else {
							that.$showToast(res.data.message);
							reject()
						}
					}).finally(() => {
						setTimeout(() => {
							this.pageLoading = false
						}, 300)
					})
				})

			}, 500),
			paymentCancellationConfirmation() {
				if (this.couponModalActE) {
					this.couponModalVisibleE = true
				}
			},
			confirmFullTip(setPageAlert = false) {
				if (!setPageAlert) {
					this.showFullPageAlert = false
				}

				if ((this.paramObj.reportId || this.paramObj.from) && this.introType == '32-multi-mbti') {
					setTimeout(() => {
						this.$refs.payAfterContinueModal.show()
					}, 500)
				}
				this.startDateTime = this.$dayjs()
				if (clockTimer) {
					clearInterval(clockTimer)
				}
				uni.setStorageSync(`sclAnswer-${this.sclId}-time`, Date.now())
				clockTimer = setInterval(() => {
					// 00:00 这种格式
					this.countTime = this.$dayjs().subtract(this.startDateTime).format('mm:ss')
				}, 1000)
			},

			async checkCurrentQuestionIsSubjectivity() {
				console.log(this.questionList[this.currentIndex].subjectivity,
					'-----this.questionList[this.currentIndex].subjectivity-------')
				if (this.questionList && this.questionList[this.currentIndex] && this.questionList[this.currentIndex]
					.subjectivity) {

					if (!this.currentInputCon) {
						return false
					}

					uni.showLoading({
						title: '加载中...'
					})
					try {
						const res = await saveOptnSubjectivity({
							sclId: this.sclId,
							optnId: this.questionList[this.currentIndex].id,
							userId: this.userId,
							subjectivityContent: this.currentInputCon
						})
						this.questionList[this.currentIndex].ansData = this.currentInputCon
						this.questionList[this.currentIndex].ansOk = true


						console.log(res, '===========res-----checkCurrentQuestionIsSubjectivity')
					} catch (e) {
						console.log(e, '-----checkCurrentQuestionIsSubjectivity')
					}

					this.$set(this.questionList, this.currentIndex, this.questionList[this.currentIndex]);

					this.currentInputCon = ''
					uni.hideLoading()
				}
			},
			processAnswer() {
				let tmpArr = []
				this.questionList.forEach((itemI, i) => {
					if (itemI.subjectivity && itemI.ansOk) {
						tmpArr.push({
							qstnNo: itemI.qstnNo,
							sclId: this.sclId,
							optnId: itemI.id,
							userId: this.userId,
							subjectivityContent: itemI.ansData,
							"changeTimes": 0,
							"ansDate": itemI.ansData,
							sqId: itemI.id
						})
					} else {
						this.questionList[i].optnList.forEach((itemJ, j) => {
							if (itemJ.select && itemJ.select == '1') {
								let data = this.questionList[i];
								tmpArr.push({
									qstnNo: itemI.qstnNo,
									optnNo: data.optnList[j].optnNo,
									"optnNum": data.optnList.length,
									"sclId": data.sclId,
									"qstnId": data.optnList[j].qstnId,
									"optnId": data.optnList[j].id,
									"score": data.optnList[j].optnScore,
									"outType": data.optnList[j].outType,
									"outId": data.optnList[j].outId,
									"changeTimes": 0,
									"ansDate": null,
								});
							}
						})
					}

				})

				return tmpArr
			},
			setQuestionAndAnswerToLocal() {
				let answerJson = [];

				this.questionList.forEach((itemI, i) => {
					if (itemI.subjectivity && itemI.ansOk) {
						answerJson.push({
							sclId: this.sclId,
							optnId: itemI.id,
							userId: this.userId,
							subjectivityContent: itemI.ansData,
							"changeTimes": 0,
							"ansDate": itemI.ansData,
							sqId: itemI.id
						})
					} else {
						this.questionList[i].optnList.forEach((itemJ, j) => {
							if (itemJ.select && itemJ.select == '1') {
								let data = this.questionList[i];
								answerJson.push({
									qstnNo: itemI.qstnNo,
									optnNo: data.optnList[j].optnNo,
									"optnNum": data.optnList.length,
									"sclId": data.sclId,
									"qstnId": data.optnList[j].qstnId,
									"optnId": data.optnList[j].id,
									"score": data.optnList[j].optnScore,
									"outType": data.optnList[j].outType,
									"outId": data.optnList[j].outId,
									"changeTimes": 0,
									"ansDate": null,
								});
							}
						})
					}
				})
				uni.setStorageSync(`sclAnswer-${this.sclId}`, JSON.stringify(answerJson))
			},
			async nextQuestion(type) {
				console.log(type, '------type-----1')
				this.oldCurrentIndex = this.currentIndex
				await this.checkCurrentQuestionIsSubjectivity()

				if (this.doQuestionType == 'jump') {
					//如果该测评是跳转型的测评，则走另一条路
					this.jumpQuestionHandle()
					return
				}

				if (this.currentIndex < this.questionList.length - 1) {
					console.log('----this.currentIndex < this.questionList.length-----')
					this.setQuestionAndAnswerToLocal()
					this.currentIndex++;
					this.getPercent();
					return
				}
				console.log('autoSelect---', type)
				if (type == 'autoSelect') return
				
				console.log('----if (this.$fangBaoClick()) return-----1')
				
				if (this.$fangBaoClick()) return
				console.log('----if (this.$fangBaoClick()) return-----2')
				this.getPercent();
				
				console.log(this.questionList, '===this.questionList==')
				let answerJson = [];
				let questionMaxLength = this.questionList.length

				console.log('-------------1-----------')

				answerJson = this.processAnswer()

				console.log(answerJson, '===answerJson==')
				console.log(this.questionList, 'this.questionList--------------------------')
				if (questionMaxLength != answerJson.length) {
					this.$showToast('请检查并完成所有的题目');
					return
				}

				console.log('variable this.isSclNotFreeAndNotOwned：', this.isSclNotFreeAndNotOwned)
				console.log('variable this.isFullPage：', this.isFullPage)
				console.log('variable this.checkFullPageOk：', this.checkFullPageOk)
				console.log('variable this.isAfterPay：', this.isAfterPay)
				console.log('variable this.isFromCheckUp：', this.isFromCheckUp)
				console.log('variable this.isPaySclExamination：', this.isPaySclExamination)

				if (
					this.isSclNotFreeAndNotOwned &&
					(
						(this.isFullPage && !this.checkFullPageOk) ||
						(this.isAfterPay && !(this.isFromCheckUp && this.isPaySclExamination))
					)
				) {
					console.log('-------------2-----------')
					//显示结果页的前一步骤
					//特殊测评在提交前 - 将内容存储到本地
					this.localAnswer = JSON.stringify(answerJson)
					uni.setStorageSync(`sclAnswer-${this.sclId}`, JSON.stringify(answerJson))

					if (
						/*!(this.isFromCheckUp && !this.isScl90) &&*/
						(
							this.endPageType /*&& this.endPageType != 'checkup' */ && this.endPageType !=
							'checkup-depressed' && (
								(this.endPageType != '32-multi-mbti-common' && this.endPageType !=
									'32-multi-mbti-normal') ||
								((this.endPageType == '32-multi-mbti-common' || this.endPageType ==
									'32-multi-mbti-normal') && !this.needBlockMulti)
							) && this.endPageType != 'fpacpt' && this.endPageType != 'animalforest' && this
							.endPageType != 'bestxg' && this.endPageType != 'queen'
						)
					) {
						this.isShowSclBeforeResultLoadPage = true
						this.showMainPage = false
						console.log('-------------3-----------')
					} else if ((this.endPageType == '32-multi-mbti-common' || this.endPageType ==
							'32-multi-mbti-noraml') && this.needBlockMulti && this.qstnNum != 100) {

						this.$refs.modalDone.show({
							qstnNum: this.qstnNum
						})
						this.needBlockMulti = false

						console.log('-------------4-----------')
					} else if (this.endPageType == '32-multi-mbti-common' && this.qstnNum == 100) {
						this.isShowEndPage = true

						this.latestEndPageType = 'xg-mbti-common'
						console.log('-------------5-----------')
					} else if (this.endPageType == '32-multi-mbti-normal') {
						this.isShowEndPage = true

						this.latestEndPageType = 'xg-mbti-normal'
					} else if (this.endPageType == 'checkup-depressed') {
						uni.redirectTo({
							url: '/subcontractorC/pages/checkupDepressed/payPage?sclId=' + this.sclId +
								`&testDuration=${new Date().getTime() - this.startTime}&userType=${this.paramObj.userType}`
						})
					} else if (this.endPageType == 'checkup-sexuality') {
						uni.redirectTo({
							url: '/subcontractorC/pages/sexuality-assessment/payPage?sclId=' + this.sclId +
								`&testDuration=${new Date().getTime() - this.startTime}&userType=${this.paramObj.userType}`
						})
					} else {
						this.isShowEndPage = true
						this.showMainPage = false
						console.log('-------------6-----------', this.endPageType)
					}

					return false
				}



				if (this.questionPageType == 'mailun') {
					this.shareData = {
						title: '定制我的脉轮水晶',
						path: '/pages/index/index?userType=mailun',
						imageUrl: this.$imgWxkjUrl + '/product/mailun_share_new_new.png'
					}
					this.localAnswer = JSON.stringify(answerJson)
					uni.setStorageSync(`sclAnswer-${this.sclId}`, JSON.stringify(answerJson))
					this.isShowSclBeforeResultLoadPage = true
					this.showMainPage = false
					console.log('-------------7-----------')
					return false
				} else if (this.endPageType == 'checkup' && this.isScl90 && this.isSclAllReport == 'N') { //简版进度加载
					this.localAnswer = JSON.stringify(answerJson)
					uni.setStorageSync(`sclAnswer-${this.sclId}`, JSON.stringify(answerJson))
					this.isShowSclBeforeResultLoadPage = true
					this.showMainPage = false
					return false
				} else if (this.isShowGiftAbs) {
					this.animationFlag = true
					this.localAnswer = JSON.stringify(answerJson)
					uni.setStorageSync(`sclAnswer-${this.sclId}`, JSON.stringify(answerJson))
					console.log('-------------8-----------')
				} else if (this.isShowYiyuanAbs) {
					this.giftModalVisible = true
					this.localAnswer = JSON.stringify(answerJson)
					uni.setStorageSync(`sclAnswer-${this.sclId}`, JSON.stringify(answerJson))
					console.log('-------------9-----------')
				} else {
					console.log('isScl90', this.isScl90)
					this.toSubmit(answerJson)
				}
				this.questionListShow = true
			},
			toSubmit(answerJson) {
				if (this.submitLoding) return false
				answerJson = answerJson.map(item => {
					item.ansDate = null
					return item
				})
				console.log(JSON.stringify(answerJson), '==答题结果')

				uni.showLoading({
					title: "提交中..."
				})

				console.log(this.paramObj.sclReportType, '==this.paramObj.sclReportType')
				let tmpSclReportType = (this.paramObj.sclReportType && this.actGroup == 'all') ? this.paramObj
					.sclReportType : 0
				console.log(tmpSclReportType, '=====tmpSclReportType')
				tmpSclReportType = (tmpSclReportType == 2 || this.paramObj.sclReportType == 3) ? 1 : tmpSclReportType

				const submitForm = removeEmptyProperty({
					type: 'order',
					sclId: this.paramObj.sclId,
					testDuration: new Date().getTime() - this.startTime,
					h5Type: this.paramObj.userType,
					answerJson: JSON.stringify(answerJson),
					sclReportType: tmpSclReportType,
					sclReportJson: this.moreAnswer || uni.getStorageSync('moreAnswer')
				})
				this.submitLoding = true
				this.$u.api.userWebAnswer(submitForm).then(res => {
					uni.removeStorageSync(`sclAnswer-${this.sclId}`)
					if (res.data.code == 2000) {
						uni.removeStorageSync('moreAnswer')
						let url = ''
						url = '/subcontractorB/pages/sclResult/sclResult?id=' + res.data.data.id +
							'&sclReportType=' + this
							.paramObj.sclReportType + '&actGroup=' + this.actGroup + '&addSclWay=' + this.addSclWay
						// debugger
						const tmpObj = res.data.usergetDiscount || {}
						if (tmpObj.code) {
							uni.setStorageSync('newCouponInfo', {
								couponId: tmpObj.id,
								couponCode: tmpObj.code,
								couponName: tmpObj.discountName,
								couponNum: tmpObj.discount
							})
						} else if (this.isShowYiyuanAbs) {
							uni.setStorageSync('getYiyuanCoupon', true)
						}
						let sclResultParams = {
							id: res.data.data.id,
							sclReportType: this.paramObj.sclReportType,
							actGroup: this.actGroup,
							addSclWay: this.addSclWay
						}
						uni.reLaunch({
							url: '/pages/sclList/sclList?sclResultParams=' + encodeURIComponent(JSON
								.stringify(sclResultParams))
						})
					} else {
						setTimeout(() => {
							this.$showToast(res.data.message);
						}, 300)
					}
				}).finally(() => {
					uni.hideLoading()
					this.submitLoding = false
				})
			},
			preQeustion() {
				if (this.currentIndex > 0) {
					if (this.doQuestionType == 'jump') {
						this.currentIndex = this.oldCurrentIndex
					} else {
						this.currentIndex--;
					}
				} else {
					this.$showToast('当前已是第一题')
				}
			},
			getPercent() {
				let doQuestionLength = 0;
				this.questionList.forEach((item, index) => {
					if (item.subjectivity && item.ansOk) {
						doQuestionLength++;
					} else {
						item.optnList.forEach((itemOptn) => {
							if (itemOptn.select && itemOptn.select == '1') {
								doQuestionLength++;
							}
						})
					}
				})

				this.percent = Math.floor(doQuestionLength / this.questionList.length * 100);
			},
			goDirectory() {
				uni.setStorageSync('questionList', JSON.stringify(this.questionList));

				uni.navigateTo({
					url: '/subcontractorC/pages/sclDirectory/sclDirectory?type=' + this.directoryType +
						'&containerClassName=' + this.containerClassName
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	@import url(sclDoQuestion.css);

	.before-end-btn-wrapper {
		position: fixed;
		padding-bottom: calc(constant(safe-area-inset-bottom));
		padding-bottom: calc(env(safe-area-inset-bottom));

		.before-end-intro-btn-inner {
			position: relative;
			display: flex;
			flex-direction: column;
			align-items: center;
			width: 750rpx;

			justify-content: center;

			.hand-img {
				width: 166rpx;
				height: 166rpx;
				position: absolute;
				right: 10%;
			}
		}
	}

	.input-wrapper {
		// width: 590rpx;
		height: 90rpx;
		background: #f5f5f5;
		border-radius: 8rpx;
		display: flex;
		align-items: center;
		box-sizing: border-box;
		padding-left: 16rpx;
	}

	// 若当前页main不再使用scl-notice-page组件即可删除该样式
	/deep/.full-page-alert::-webkit-scrollbar {
		width: 6px; // 设置滚动条宽度
		background: #d7e8b0;
		// border-radius: 3px;  // 设置滚动条边框圆角
	}

	/deep/.full-page-alert::-webkit-scrollbar-thumb {
		// background-color: #999;  // 设置滚动条颜色
		background: #d7e8b0;
		border-radius: 3px; // 设置滚动条边框圆角
	}

	/deep/.full-page-alert::-webkit-scrollbar-thumb:hover {
		background-color: #d7e8b0; // 设置鼠标悬停时的滚动条颜色
	}

	/deep/.full-page-alert::-webkit-scrollbar-track {
		background-color: #f5f5f5; // 设置滚动条轨道颜色
	}

	/* 定义闪烁动画效果 */
	@keyframes blink {
		50% {
			opacity: 0;
		}
	}

	/* 将动画应用于需要闪烁的元素 */
	.blinking {
		animation: blink 5s infinite;
	}

	/* 定义旋转动画效果 */
	@keyframes rotate {
		50% {
			rotate: 180deg;
		}
	}

	.rotating {
		animation: rotate 1s infinite;
	}

	.shake {
		animation: shakebox 3s linear infinite;
		animation-delay: 2s;
	}

	@keyframes shakebox {
		0% {
			transform: translateZ(0);
		}

		5% {
			transform: translate3d(5px, 5px, 0);
		}

		15% {
			transform: translate3d(-5px, -5px, 0);
		}

		25% {
			transform: translate3d(5px, 5px, 0);
		}

		45% {
			transform: translate3d(-5px, -5px, 0);
		}

		55% {
			transform: translate3d(5px, -5px, 0);
		}

		65% {
			transform: translate3d(-5px, -5px, 0);
		}

		80% {
			transform: translate3d(5px, 5px, 0);
		}

		100% {
			transform: translate3d(-5px, -5px, 0);
		}
	}

	.animation-open {
		animation: open 1.5s;
	}

	@keyframes open {
		0% {
			transform: scale(1) translate3d(0, 0, 0);
		}

		100% {
			transform: scale(4) translate3d(0, 120rpx, 0);
		}
	}

	.scroll-wrap {
		flex: 1;
		height: 0;
		width: 100%;
		position: relative;
	}

	.scroll-wrap-qst {
		// flex: 1;
		height: auto;
		max-height: 50%;
		width: 100%;
		position: relative;
	}

	.do-page-container {
		display: flex;
		flex-direction: column;
		align-items: center;
		height: 100vh;
		// padding-top: 60rpx;
		padding-top: 156rpx;
		background-repeat: no-repeat;
		background-size: cover;
		box-sizing: border-box;
		padding-bottom: 200rpx;

		.question-content-box {
			min-height: 60vh;

			padding-bottom: 30rpx;
			display: flex;
			flex-direction: column;
			// align-items: center;
			overflow: hidden;
		}

		.pb-jd-title {
			font-family: PingFangSC, PingFang SC;
			font-weight: 500;
			font-size: 18rpx;
			color: #2e8013;
			line-height: 25rpx;
			// text-align: left;
			font-style: normal;
		}

		.pb-jd-percent {
			font-family: Helvetica, Helvetica;
			font-weight: bold;
			font-size: 54rpx;
			color: #58b938;
			line-height: 65rpx;
			text-align: left;
			font-style: normal;
		}

		.center-box {
			padding-top: 0;

			.question-info-wrapper {
				display: flex;
				justify-content: space-between;

				.clock-wrapper {
					display: flex;
					align-items: center;

					.clock-icon {
						width: 36rpx;
						height: 36rpx;
						margin-right: 10rpx;
					}

					.clock-text {
						font-family: PingFangSC, PingFang SC;
						font-weight: 400;
						font-size: 30rpx;
						color: #999999;
						line-height: 42rpx;
						text-align: left;
						font-style: normal;
					}
				}
			}
		}

		.progress-box {
			top: -80rpx;
		}

		.bottom-btn {
			bottom: 80rpx;
		}

		// 测评样式
		&.mentalHealth {
			.qcb-num {
				color: #046498;

				.max-question-length {
					font-size: 20rpx;
				}
			}

			.progress-box {
				.progress-flash {
					width: 100%;
					height: 100%;
				}
			}

			.bottom-btn {
				.bb-pre-next {
					border-color: #2BB4EC;
					color: #0A78A9;
				}

				.bb-ml {
					background-image: linear-gradient(180deg, #4FD9F4 0%, #179FE7 100%) !important;
				}
			}

			.pb-text {
				.pb-jd-percent {
					font-weight: bold;
					font-size: 45rpx;
					color: #046498;
					line-height: 54rpx;
					text-shadow: 2rpx -2rpx 0 #FFF, 2rpx -2rpx 0 #FFF, -2rpx 2rpx 0 #FFF, 2rpx 2rpx 0 #FFF;
					white-space: nowrap;
				}

				.pb-jd-title {
					font-size: 24rpx;
					color: #046498;
					font-weight: bold;
					line-height: 33rpx;
					white-space: nowrap;
				}
			}
		}

		&.depressed {
			.qcb-num {
				color: #16715E;

				.max-question-length {
					font-size: 20rpx;
				}
			}

			.progress-box {
				.progress-flash {
					width: 100%;
					height: 100%;
				}
			}

			.bottom-btn {
				.bb-pre-next {
					border-color: #4EBAB1;
					color: #16715E;
				}

				.bb-ml {
					background-image: linear-gradient(180deg, #4FD9F4 0%, #18A4AC 100%) !important;
				}
			}

			.pb-text {
				.pb-jd-percent {
					font-weight: bold;
					font-size: 45rpx;
					color: #16715E;
					line-height: 54rpx;
					text-shadow: 2rpx -2rpx 0 #FFF, 2rpx -2rpx 0 #FFF, -2rpx 2rpx 0 #FFF, 2rpx 2rpx 0 #FFF;
					white-space: nowrap;
				}

				.pb-jd-title {
					font-size: 24rpx;
					color: #16715E;
					font-weight: bold;
					line-height: 33rpx;
					white-space: nowrap;
				}
			}
		}

		&.sexuality {
			.qcb-num {
				color: #023C7B;

				.max-question-length {
					font-size: 20rpx;
				}
			}

			.progress-box {
				.progress-flash {
					width: 100%;
					height: 100%;
				}
			}

			.bottom-btn {
				.bb-pre-next {
					background-color: transparent;
					border-color: transparent;

					.img {
						width: 220rpx;
						height: 100rpx;
					}
				}

				.bb-ml {
					background-color: transparent;
					border-color: transparent;
					background-image: none !important;

					.img {
						width: 200rpx;
						height: 95rpx;
					}
				}
			}

			.pb-text {
				.pb-jd-percent {
					font-weight: bold;
					font-size: 45rpx;
					color: #0B3973;
					line-height: 54rpx;
					text-shadow: 2rpx -2rpx 0 #FFF, 2rpx -2rpx 0 #FFF, -2rpx 2rpx 0 #FFF, 2rpx 2rpx 0 #FFF;
					white-space: nowrap;
				}

				.pb-jd-title {
					font-size: 24rpx;
					color: #002452;
					font-weight: bold;
					line-height: 33rpx;
					white-space: nowrap;
				}
			}
		}

		&.goddess,
		&.queen {
			.qcb-num {
				color: #BB3948;

				.max-question-length {
					font-size: 20rpx;
				}
			}

			.progress-box {
				.progress-flash {
					width: 100%;
					height: 100%;
				}
			}

			.bottom-btn {
				.bb-pre-next {
					border-color: #AF5F6C;
					color: #AF5F6C;
				}

				.bb-ml {
					background-image: linear-gradient(180deg, #FFCDE4 0%, #F06270 100%) !important;
				}
			}

			.pb-text {
				.pb-jd-percent {
					font-weight: bold;
					font-size: 45rpx;
					color: #77232F;
					line-height: 54rpx;
					text-shadow: 2rpx -2rpx 0 #FFF, 2rpx -2rpx 0 #FFF, -2rpx 2rpx 0 #FFF, 2rpx 2rpx 0 #FFF;
					white-space: nowrap;
				}

				.pb-jd-title {
					font-size: 24rpx;
					color: #77232F;
					font-weight: bold;
					line-height: 33rpx;
					white-space: nowrap;
				}
			}
		}


	}

	.progress-box-b {
		position: absolute;
		top: 0;
		left: 50%;
		transform: translateX(-50%);
		// background-color: #FFFFFF;
		border-radius: 50%;

		.pb-text {
			height: 160rpx;
			width: 160rpx;
			// margin-top: 10rpx;
			border-radius: 50%;
			background-size: cover;
			background-repeat: no-repeat;

			.pb-jd-title {
				font-size: 22rpx;
				font-family: PingFangSC-Medium, PingFang SC;
				font-weight: 500;
				color: #4851ba;
				line-height: 33rpx;
				margin-top: 12rpx;
			}

			.pb-jd-percent {
				margin-top: 4rpx;
				font-size: 50rpx;
				font-family: DINCondensed-Bold, DINCondensed;
				font-weight: bold;
				color: #5a63d3;
				// line-height: 79rpx;
				-webkit-text-stroke: 0.5rpx #ffffff;
				text-stroke: 0.5rpx #ffffff;
			}
		}
	}

	.qcb-num-b {
		color: #747de6;
	}

	.bottom-btn-b {

		.bb-pre-next,
		.bb-pre-next {
			border: none;
			color: #747de6;
		}

		.bb-ml {
			background-size: cover;
			border: none;
			background-repeat: no-repeat;
			width: 206rpx;
			height: 108rpx;
		}
	}

	.progress-box {
		.progress-flash {
			position: absolute;
			// width: 308rpx;
			// height: 308rpx;
			width: 300rpx;
			height: 300rpx;
			top: 50%;
			background-repeat: no-repeat;
			transform: translate(-50%, -50%);
			left: 50%;
			// background: url(https://webstatic.feifanxinli.com/talkTimeUserClient/images/scl/flash.png);
			background-size: contain;

			.img {
				width: 100%;
				height: 100%;
			}
		}

		.gift-img-abs {
			position: absolute;
			top: -46rpx;
			left: 50%;
			transform: translateX(-50%);
			width: 104rpx;
			height: 110rpx;
			z-index: 999;
			overflow: initial;

			// margin: auto;
			// margin-top: 16rpx;
			.gift-img {
				// width: 100%;
				// height: 100%;
				width: 104rpx;
				height: 110rpx;
				position: absolute;
				left: 0;
				top: 0;
				z-index: 981;
			}
		}

		.chat-img-abs {
			position: absolute;
			top: -46rpx;
			// right: -100%;
			right: -190rpx;
			width: 206rpx;
			height: 128rpx;
			background-repeat: no-repeat;
			background-size: contain;
			// margin: auto;

			font-family: PingFangSC, PingFang SC;
			font-weight: 500;
			font-size: 26rpx;
			color: #ffffff;
			line-height: 37rpx;
			text-align: left;
			font-style: normal;

			box-sizing: border-box;
			padding-left: 24rpx;
			padding-top: 12rpx;

			.chat-img {
				width: 100%;
				height: 100%;
			}
		}

		.yiyuan-chat-img-abs {
			top: -42rpx;
			// right: -100%;
			right: -230rpx;
			width: 256rpx;
			height: 106rpx;
		}

		.yiyuan-img-bas {
			top: -78rpx;

			.gift-img {
				width: 104rpx;
				height: 126rpx;
			}
		}
	}

	.scl-do-page-b {
		.menu-btn {
			font-size: 50rpx;
			font-family: PingFang-SC-Bold, PingFang-SC;
			font-weight: bold;
			color: #ffffff;
			line-height: 70rpx;
			-webkit-text-stroke: 1px #a55c08;
			text-stroke: 1px #a55c08;
			line-height: 108rpx;
		}

		.max-question-length {
			font-size: 24rpx;
		}
	}

	.loop-pointer {
		animation-iteration-count: infinite;
		animation-name: loading;
		animation-duration: 1000ms;
		animation-delay: 0;
		animation-timing-function: ease;
	}

	@keyframes loading {
		0% {
			transform: scale(1);
		}

		50% {
			transform: scale(0.82);
		}

		100% {
			transform: scale(1);
		}
	}

	.question-fill-end-page {
		background-size: 100% 100%;
		width: 750rpx;
		height: 100%;
		min-height: 100vh;
		background-color: #000;
		box-sizing: border-box;
		position: relative;
		transition: all 0.5s;

		.tip-wrapper {
			position: fixed;
			top: 40vh;
			width: 100vw;
			display: flex;
			justify-content: center;

			.img {
				width: 362rpx;
				height: 214rpx;
			}
		}

		.btn-wrapper {
			width: 100vw;
			height: 140rpx;
			// background-color: red;
			position: fixed;

			.btn-inner-wrapper {
				position: relative;
				width: 100%;
				height: 100%;
				display: flex;
				justify-content: center;

				.main-img {
					width: 380rpx;
					height: 96rpx;
					margin: auto;
				}

				.main-img-2 {
					width: 322rpx;
					height: 141rpx;
				}

				.img {
					position: absolute;
					width: 116rpx;
					height: 116rpx;

					bottom: -50rpx;
					right: 134rpx;
				}

				.img-2 {
					right: 154rpx;
				}
			}
		}

		.price-wrapper-pos {
			position: fixed;
		}
	}

	.price-wrapper {
		.price-icon {
			font-size: 20rpx;
		}

		text-align: center;
		display: flex;
		justify-content: center;
		width: 100%;
		left: 0;
		right: 0;

		font-size: 30rpx;
		font-family: PingFangSC,
		PingFang SC;
		// font-weight: 500;
		color: #fbd8a6;
		// line-height: 17rpx;

		.current-price-icon {
			transform: scale(0.5);
			line-height: 50rpx;
		}
	}

	.before-end-price-wrapper {
		display: flex;
		align-items: center;
		justify-content: center;

		width: 552rpx;
		height: 92rpx;
		margin: auto;
		margin-top: 26rpx;

		background-size: 100%;
		background-repeat: no-repeat;
	}

	.before-end-to-home-wrapper {
		margin-top: 30rpx;
		font-family: PingFangSC, PingFang SC;
		font-weight: 400;
		font-size: 28rpx;
		color: rgba(255, 255, 255, 0.7);
		line-height: 64rpx;
		text-align: center;
		font-style: normal;

		width: 298rpx;
		height: 64rpx;
		background: #c98b4e;
		border-radius: 32rpx;
	}
</style>